Skip to content

feat(Modal): add launcherButtonRef prop to handle focus on close#14355

Merged
tw15egan merged 2 commits into
carbon-design-system:mainfrom
tw15egan:modal-focus
Jul 31, 2023
Merged

feat(Modal): add launcherButtonRef prop to handle focus on close#14355
tw15egan merged 2 commits into
carbon-design-system:mainfrom
tw15egan:modal-focus

Conversation

@tw15egan

Copy link
Copy Markdown
Contributor

Closes #13680

Adds a new launcherButtonRef to Modal and ComposedModal. This allows a user to pass in a ref to the button that is used to launch the Modal

Changelog

New

  • launcherButtonRef prop added to Modal / ComposedModal.

Changed

  • Updated the state manager stories to use the new launcherButtonRef prop to handle focus returning to the button when the Modal / ComposedModal is closed

Testing / Reviewing

Ensure focus returns to the button when closing either Modal / ComposedModal via keyboard or mouse click

@netlify

netlify Bot commented Jul 31, 2023

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 0ccffe8
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/64c81da4376c090008a8ceeb
😎 Deploy Preview https://deploy-preview-14355--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify

netlify Bot commented Jul 31, 2023

Copy link
Copy Markdown

Deploy Preview for carbon-components-react ready!

Name Link
🔨 Latest commit 0ccffe8
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/64c81da43f96a200081a6e89
😎 Deploy Preview https://deploy-preview-14355--carbon-components-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@andreancardona andreancardona left a comment

Copy link
Copy Markdown
Contributor

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?

@tw15egan

Copy link
Copy Markdown
Contributor Author

@andreancardona updated the tests to account for the new behavior

@tay1orjones tay1orjones left a comment

Copy link
Copy Markdown
Member

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 👍

@github-actions github-actions Bot added this pull request to the merge queue Jul 31, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jul 31, 2023
@tw15egan tw15egan added this pull request to the merge queue Jul 31, 2023
Merged via the queue into carbon-design-system:main with commit 35fc72f Jul 31, 2023
@tw15egan tw15egan deleted the modal-focus branch July 31, 2023 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[a11y]: Modal: doesn't return focus properly on dismissal

3 participants