You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] WhileHover not working when motion component contains animate props that is a variant string #2542
Please refer to the screenshot below. The goal is to animate child component when hovering on the parent, but when the child specifies the animate props which is a string defined in child's variant the whileHover has no effect
Closing as intended behaviour. A component that sets its own animate prop becomes the variant controller for itself and its children, so it stops inheriting variant changes (including whileHover) from its parent. I confirmed this on framer-motion 11.0.14 and on current main: a child with animate="visible" and a hover variant keeps opacity: 1 while the parent is hovered. To have the child react to the parent's hover, remove animate from the child and set initial/animate on the parent (the label flows down), or drive the child from parent state.
Please refer to the screenshot below. The goal is to animate child component when hovering on the parent, but when the child specifies the animate props which is a string defined in child's variant the whileHover has no effect
