Skip to content
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

[Dialog, Popover] Provide a callback for open/close completion #1208

Open
vladmoroz opened this issue Dec 20, 2024 · 1 comment · Fixed by #1235 · May be fixed by #1305
Open

[Dialog, Popover] Provide a callback for open/close completion #1208

vladmoroz opened this issue Dec 20, 2024 · 1 comment · Fixed by #1235 · May be fixed by #1305
Assignees
Labels
component: dialog This is the name of the generic UI component, not the React module! component: popover The React component. enhancement This is not a bug, nor a new feature

Comments

@vladmoroz
Copy link
Contributor

vladmoroz commented Dec 20, 2024

A prop like onOpenChangeComplete is needed for callbacks that need to run when a component gets fully hidden with all animations done, e.g. to reset its internal state. Doing that in onOpenChange would yield a flash of contents.

@vladmoroz vladmoroz added enhancement This is not a bug, nor a new feature component: dialog This is the name of the generic UI component, not the React module! component: popover The React component. labels Dec 20, 2024
@atomiks
Copy link
Contributor

atomiks commented Dec 21, 2024

I think onHidden makes sense as a prop. There isn't value in knowing when open has finished animating in, only animating out?

The State of these elements can contain hidden, which is !mounted internally, which represents when it's unmounted from the DOM or has the hidden prop applied with keepMounted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: dialog This is the name of the generic UI component, not the React module! component: popover The React component. enhancement This is not a bug, nor a new feature
Projects
None yet
2 participants