79830736

Date: 2025-11-26 13:16:22
Score: 2
Natty:
Report link

I am facing the similar issue when animation width - 'auto' on animate the animation jitters a little bit at the end of exit.

      <motion.div
        style={{ justifyContent: 'flex-end' }}
        className="flex items-center gap-4 bg-background backdrop-blur-2xl border rounded-full p-2 origin-right h-9"
      >
        <AnimatePresence mode='wait'>
          {isActive && (
            <motion.div
              layout
              layoutId='item'
              initial={{ width: 0, opacity: 0, filter: 'blur(2px)' }}
              animate={{ width: 'auto', opacity: 1, filter: 'blur(0px)' }}
              exit={{ width: 0, opacity: 0, filter: 'blur(2px)' }}
              transition={{
                duration: 0.3,
                ease: 'easeInOut',
                delayChildren:0.1
              }}
              style={{ transformOrigin: 'right' 
               }}

              className="overflow-hidden relative"
            >
              <div className='flex items-center gap-4'>
              <NavigationItem text="Home" href="/" />
              <NavigationItem text="Documentation" href="/docs" />
              </div>
            
            </motion.div>
          )}
        </AnimatePresence>

        <Menu
          animate={isActive == true ? true : false}
          className="w-5 h-5 flex-shrink-0"
          onClick={() => setIsActive(!isActive)}
        />
      </motion.div>
Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): I am facing the similar issue
  • Low reputation (1):
Posted by: Parth Arora