-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add animation complete callbacks #7630
Comments
The implementation around animations was recently changed to support CSS transitions, hence why you won't find references to the That being said, if you want to contribute, it should be fairly trivial to add something like |
This PR adds `onEnterComplete` and `onExitComplete` callbacks to components in `react-aria-components` which have enter and exit animations. Closes adobe#7630.
@nwidynski thanks for the pointers, contributed in #7633. Let me know if there's anything I need to do to get that to be accepted and merged! |
@cprussin Thank you very much 👍 It's likely the core team will ask you to move the For additional feedback I'm sure the core maintainers will get back to you, as they decide whether these changes make it 🚀 |
This PR adds `onEnterComplete` and `onExitComplete` callbacks to components in `react-aria-components` which have enter and exit animations. Closes adobe#7630.
Great suggestions, thanks @nwidynski ! I implemented both; I'll hold tight and see what the core maintainers have to say. Thanks again! |
Can you use the web apis which returns a promise when the animation completes? In our animation hooks, we think the callback would fire a bit too early, as it'd happen after only one frame. We could consider a convenience API for this, but we'd need to listen for the same thing I mentioned in the place where 'onEnd' is fired in your PR, then once the promise resolves is when we'd actually call the prop. |
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
andonExitComplete
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:
💻 Examples
No response
🧢 Your Company/Team
Douro Labs
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: