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

Shift and shift+tab focus items of the body when modal is open #1679

Open
dsolovieva opened this issue Oct 21, 2019 · 3 comments
Open

Shift and shift+tab focus items of the body when modal is open #1679

dsolovieva opened this issue Oct 21, 2019 · 3 comments

Comments

@dsolovieva
Copy link

@dsolovieva dsolovieva commented Oct 21, 2019

  • components: modal
  • reactstrap version #6.4.0
  • import method es
  • react version #16.4.0
  • bootstrap version #4.1.1

What is happening?

If you open the modal, focus any browser element (e.g. address bar), and start to press the tab key to move the focus forward body elements get the focus as usual.

What should be happening?

As described in https://www.w3.org/TR/wai-aria-practices/#dialog_modal elements outside the modal dialog should not be interactive:

Windows under a modal dialog are inert. That is, users cannot interact with content outside an active dialog window.

Additionally, here is an example of implementation: https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html

Steps to reproduce the issue

  1. Go to the http://reactstrap.github.io/components/modals/
  2. Open the modal dialog
  3. Set focus to the address bar of the browser
  4. Press tab until focus goes inside the page
@dsolovieva
Copy link
Author

@dsolovieva dsolovieva commented Oct 22, 2019

@TheSharpieOne
Copy link
Member

@TheSharpieOne TheSharpieOne commented Oct 22, 2019

It looks like bootstrap is capturing all of the focus events and looking to see if the element focused is within the modal or not. If the element focused is not within the modal, it will focus the modal. This works for when tabbing from the address bar, but is completely broken when shift-tabbing. Bootstrap is planning a new implementation with v5.
For now, I think their approach has some merit. It, combined with the what we currently have should fix this issue as well as continue to work for shift-tabbing.

@waqasnasir
Copy link

@waqasnasir waqasnasir commented Oct 24, 2019

can I work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.