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

fix(ComposedModal): close modal with esc key when no element has focus #11609

Merged
merged 5 commits into from
Jun 17, 2022

Conversation

tw15egan
Copy link
Member

Closes #10193

After doing a bit of digging between Modal and ComposedModal it seems like the div needs a tabIndex in order for onKeyDown events to fire.

Changelog

Changed

  • Added a tabIndex to the outer ComposedModal div so that all keypress events are captured

Testing / Reviewing

Open ComposedModal with State Manager example. Open the Modal, click on the text (to lose focus from the input), and try closing the modal with the esc key

@netlify
Copy link

netlify bot commented Jun 13, 2022

Deploy Preview for carbon-components-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 78cd3bb
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/62acbb290e111500082cbfba
😎 Deploy Preview https://deploy-preview-11609--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 settings.

@netlify
Copy link

netlify bot commented Jun 13, 2022

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 78cd3bb
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/62acbb29b6c69e0008fa1f52
😎 Deploy Preview https://deploy-preview-11609--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 settings.

Copy link
Contributor

@jnm2377 jnm2377 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review! It's working as expected for me! 🔥

@kodiakhq kodiakhq bot merged commit f72a96a into carbon-design-system:main Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Bug]: Pressing the escape key wont close composed modal
3 participants