Skip to content

[BUG] WhileHover not working when motion component contains animate props that is a variant string #2542

Description

@AsuraKev

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
image

Activity

  1. mattgperry commented on Oct 5, 2026

    @mattgperry
    Collaborator

    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.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions