Skip to content

Components get duplicated when having a animation on mount and triggering it fast #134

@ricklancee

Description

@ricklancee

When having a simple mount/unmount animation on click and when the user presses the mouse button really fast each time the user clicks a new element is created if the animation was not completed. Resulting in many duplicated components and mount triggers. This seems unexpected.

Gif: https://gyazo.com/dea3ca7a09b1ffbb8f0b3f454f906dc1

Code: https://codesandbox.io/s/w0jj62rj45
open up developer tools and click the mouse button very fast on the list. You will see more than 2 components rendered in the dom

I would expect only a maximum of two items to be rendered in this case. Is this a know bug? Or is there a way to fix this? Or can i cancel running animations to avoid this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions