-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
bootstrap-modal.js requires tabindex="-1" for escape key to work in Chrome/FireFox? #4854
Comments
Setting tabindex="-1" doesn't solve the problem on Opera 12.0.2. Modals still don't close when you hit the escape key. |
Hey @jdaigle, Thanks for opening this issue! Unfortunately, it looks like it fails to pass the criteria neccessary for submitting to bootstrap. The following things are currently failing:
For a full list of issue filing guidelines, please refer to the bootstrap issue filing guidelines. thanks! |
@malandrew Here is an example: http://jsbin.com/welcome/28240 Click the button and press escape, and nothing happens. If you edit the source and include tabindex="-1" on the #myModal div, suddenly it works (if you pop out the output). |
@mchiocca In regards to the opera issue it seems that the That said, it seems the |
yeah you need it. |
i meet a problem. |
Same issue as @Borisyu, but with redactor. Removing |
I just happened to encounter this issue, the problem is related to focus being lost to the body
|
I came here looking for solution where opening modal from within other modal is stealing focus when tabindex is -1, meanwhile i made my own solution to this problem as I use external package which uses tabindex.
|
It appears that in order for the escape key to work with bootstrap-modal.js in Chrome and FireFox, your modal div must contain the attribute
tabindex="-1"
. The example in the documentation includes this attribute but you can reproduce the issue by removing the attribute from the example modal.I can reproduce this in Chrome 21 and FireFox 15. Interestingly this is not an issue in IE 8/9.
If this requirement is not a bug, then I think it should be noted in the documentation.
The text was updated successfully, but these errors were encountered: