-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(Modal): add launcherButtonRef prop to handle focus on close #14355
Conversation
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-components-react ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Other than the AVT test failing - looks good. I wonder if we can just specify that test to get it to pass?
@andreancardona updated the tests to account for the new behavior |
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.
Thanks for updating both Modal and ComposedModal 👍
Closes #13680
Adds a new
launcherButtonRef
toModal
andComposedModal
. This allows a user to pass in aref
to the button that is used to launch theModal
Changelog
New
launcherButtonRef
prop added toModal
/ComposedModal
.Changed
launcherButtonRef
prop to handle focus returning to the button when theModal
/ComposedModal
is closedTesting / Reviewing
Ensure focus returns to the button when closing either
Modal
/ComposedModal
via keyboard or mouse click