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
Improve menu controlling with onOpenChange
#17712
Conversation
Adds `onOpenChange` callback to the `Menu` which is called when the internals of the menu component request a change to the open state of the menu. When the menu is not controlled (i.e. no `open`) prop, this callback can be used to watch the changes of the menu internal state. When the menu is controlled, allows the consumer to benefit from the popup edge cases that are used internally.
onOpenChange
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: a265b97604609b3f3b1f972aad63ab58859e6e3b (build) |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit be151dd:
|
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Perf comparison
Perf tests with no regressions
|
🎉 Handy links: |
🎉 Handy links: |
🎉 Handy links: |
* Improve menu controlling Adds `onOpenChange` callback to the `Menu` which is called when the internals of the menu component request a change to the open state of the menu. When the menu is not controlled (i.e. no `open`) prop, this callback can be used to watch the changes of the menu internal state. When the menu is controlled, allows the consumer to benefit from the popup edge cases that are used internally. * remove console * useEventCallback * remove console * improve types * Change files * add tests
Pull request checklist
$ yarn change
Description of changes
Adds
onOpenChange
callback to theMenu
which is called when the internals of the menu component request a change to the open state of the menu.When the menu is not controlled (i.e. no
open
) prop, this callback can be used to watch the changes of the menu internal state.When the menu is controlled, allows the consumer to benefit from the popup edge cases that are used internally.