motion icon indicating copy to clipboard operation
motion copied to clipboard

[BUG] layoutid has incorrect positioning when height adjusts

Open Sebastian-Nielsen opened this issue 1 year ago • 1 comments

These two issues touching on the same bug has still not been properly addressed:

  1. https://github.com/framer/motion/issues/1972
  2. https://github.com/framer/motion/issues/2006

The solution to simply add image

wont work for the case when your layoutid is to animate vertically. E.g. imagine a case where you stacked the navigation buttons vertically as opposed to horizontally.

Sebastian-Nielsen avatar Feb 11 '24 11:02 Sebastian-Nielsen

This indeed does not work, here is a quick sandbox for it: https://codesandbox.io/p/devbox/framer-motion-layoutid-bug-vertical-scroll-v92zzt Edit: Managed to fix with something like this: style={isMobile ? { originY: '0px' } : { originX: '0px' }} But still the animation will work only if it's one directional where isMobile is a custom hook for mobile devices' detection (used in my case since my navbar positioning is vertical on desktop and horizontal on mobile).

kKaskak avatar Mar 22 '24 13:03 kKaskak