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

Modal should trap focus #310

Closed
TheSharpieOne opened this issue Jan 27, 2017 · 2 comments · Fixed by #1176
Closed

Modal should trap focus #310

TheSharpieOne opened this issue Jan 27, 2017 · 2 comments · Fixed by #1176

Comments

@TheSharpieOne
Copy link
Member

  • version v4.0.1
  • components: Modal

Steps to reproduce issue

Open modal and hit tab. Focus should stay in the modal. You should not be able to focus on the element behind the modal/backdrop.

https://reactstrap.github.io/components/modals/
http://v4-alpha.getbootstrap.com/components/modal/

@toddgeist
Copy link

Safari on mac OS Sierra shows the problem.
With Chrome, you can't focus on anything behind the modal. But it tabbing does take you off to the Window elements. So it isn't as bad.

@chrismay
Copy link

With Chrome, you can't focus on anything behind the modal.

Chrome (65 on Linux, at least) does allow you to focus on elements behind the modal, but you have to tab through the URL bar first.

On the reactstrap demo page linked above, clicking "launch modal" and then pressing tab-tab-tab-tab-tab-esc-tab will put the focus onto the first clickable element on the page, the "Reactstrap" link behind the modal. (The "esc" dismisses the URL bar autocomplete). Subsequent tabs will navigate through the component menu on the right-hand-side of the page.

monteith pushed a commit to monteith/reactstrap that referenced this issue Aug 4, 2018
@monteith monteith mentioned this issue Aug 4, 2018
11 tasks
monteith pushed a commit to monteith/reactstrap that referenced this issue Aug 11, 2018
* Handle IE's inconsistent activeElement
* Filter out input[type=hidden]
* Add a few more elements to focus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants