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/Modal] Dialog and Modals should trap focus. #14509

Closed
ryanmitts opened this issue Feb 12, 2019 · 4 comments
Closed

[Dialog/Modal] Dialog and Modals should trap focus. #14509

ryanmitts opened this issue Feb 12, 2019 · 4 comments
Labels
accessibility a11y component: modal This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists

Comments

@ryanmitts
Copy link

  • [ x] This is not a v0.x issue.
  • [ x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

Dialogs and modals should trap your browsers focus when tabbing to just that open dialog of modal. This is for accessibility and ease of keyboard use of a site.

The breaking behavior is when focus reaches the last focusable element of a dialog, the focus should loop around to the first element.

This is described in these recommendations from W3.

Current Behavior 😯

When focus reaches the last focusable element of a dialog, the focus continues outside the dialog area.

Steps to Reproduce 🕹

Link:

  1. https://material-ui.com/demos/dialogs/
  2. https://material-ui.com/utils/modal/

Context 🔦

This is an issue for accessibility and those who use a keyboard to navigate, you lose track of where your focus is and the focus may be completely behind the dialog that you must interact with.

Your Environment 🌎

Tech Version
Material-UI v3.9.2
React 16.4.0
Browser Chrome 72
TypeScript 2.9.1
@joshwooding
Copy link
Member

Is this a duplicate of #13702?

@ryanmitts
Copy link
Author

ryanmitts commented Feb 12, 2019

@joshwooding They are related. If this behavior described in this ticket was working, that ticket behavior would (likely) not happen. I feel like this is the root cause of the behavior in that ticket.

@joshwooding
Copy link
Member

Although the title is different I think this is covered in #13702 so I'm closing this.
Please contribute to #13702

@joshwooding joshwooding added the duplicate This issue or pull request already exists label Feb 12, 2019
@oliviertassinari
Copy link
Member

@ryanmitts Thank you for raising the problem!

@eps1lon eps1lon added the accessibility a11y label Feb 13, 2019
@oliviertassinari oliviertassinari added the component: modal This is the name of the generic UI component, not the React module! label Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y component: modal This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants