Skip to content

Add animation complete callbacks #7630

Open
@cprussin

Description

Provide a general summary of the feature here

I'd like a callback that I can execute when animations end for things like Modal in react-aria-components

🤔 Expected Behavior?

Ideal would be a set of props like onEnterComplete and onExitComplete which would accept functions and call them when the relevant animations are finished.

Barring that, a stable / documented way to hook into the animationend event; I can't seem to find a great way to do it due to how the components are getting unmounted inside of react-aria-components.

😯 Current Behavior

As far as I know there's no way to trigger such events aside from just setting a timeout equal to the length of the animation.

💁 Possible Solution

No response

🔦 Context

I have a few use cases that this would help with:

  1. When clicking on a link in an overlay modal, I want to close the menu first, and THEN trigger the route change
  2. I have some page styling that I want to apply whenever the overlay is visible at all, including when it's animating in AND out

💻 Examples

No response

🧢 Your Company/Team

Douro Labs

🕷 Tracking Issue

No response

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