-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
[popups] onOpenChangeComplete
prop
#1305
base: master
Are you sure you want to change the base?
Conversation
Netlify deploy preview |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
05afb45
to
aec975d
Compare
onOpenChangeComplete
prop
Signed-off-by: atomiks <[email protected]>
* Calls the provided function when the CSS open animation or transition completes. | ||
*/ | ||
export function useOpenChangeComplete(parameters: useOpenChangeComplete.Parameters) { | ||
const { open, change = 'close', ref, onComplete: onCompleteParam } = parameters; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be a bit more readable if this change
param didn't have a default, but it probably doesn't matter outside of looking at this code in Github
anyway I tested onOpenChangeComplete
in a bunch of our hero demos and it works well (they all use CSS transitions) 👍
CC @michaldudak to review the implementation as well 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was a small optimization since it's called in many of the root components
Closes #1208
New alternative to #1235 to support both symmetric open/close cases, which has a more intuitive API.
useAfterExitAnimation
to support both open/close animationsonOpenChangeComplete
is called withopen: boolean