-
-
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
Modal Close On Escape keyboard = true Does Not Work #4663
Comments
works fine here... |
Are you using the latest version |
latest is 2.1.1-wip, you tried that ? |
Only want to use releases. Can you confirm that in |
Confirmed, does not work properly in Click the button, then hit |
Hey @nodesocket, 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! |
The fiddle is right here: http://jsfiddle.net/4EUS6/ |
Here is the Firebug console error message I get for this issue :
jQuery line involved is inthis block of code :
|
Any ideas? Is this confirmed? Thanks. |
I have the same problem with FF15. After closing the modal dialog (with a mouse click) I get the exposedProps error message. Any concurrent javascript action breaks then. However the example on twitter bootstrap is working fine. Will do further research.. EDIT: After disabling the FireQuery Plugin and restarting Firefox the issue is solved! |
I am upgrading one of our apps from 2.0.1 to 2.1.1 and experiencing this issue on both Chrome and Firefox on OS X. I don't have FireQuery on Firefox, but I also don't see any errors in the console in either browser. The jsFiddle posted by @nodesocket gives me the same result, not sure if I need to create another, but would love to add my +1 on this issue ;) |
Make sure tabindex is set on the modal: http://jsfiddle.net/DCUYy/ This seems to be a breaking change in 2.1 as previously the keyup event was bound to the document but now is bound to the actual modal element. Hence, the the tabindex attribute is now required. |
Weird, in the previous version Thanks. |
Not sure, @fat may be able to offer a better explanation. My guess would be for performance or interference with other keyup events on the page. A nice feature might be to automatically add tabindex="-1" if keyboard=true in the Modal class because right now this would be broken for anyone upgrading to 2.1. |
Word, I like the idea of adding |
I did it in JS at the app's $.ready(). No way I was going to go back and On Fri, Sep 7, 2012 at 2:19 PM, NodeSocket notifications@github.com wrote:
|
Hey @nodesocket, 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! |
Got it working by adding a line in version 2.2.1 bootrstrap.js:917 $this.attr('tabindex', -1) |
you shouldnt need to do that if you have tabindex="-1" on the modal div itself.. not tested though |
Adding |
As this works in the docs now, I'm going to close it out. Please open a new issue against the latest code if the problem persists. Also, please include a jsfiddle with the bug and if possible a recommended solution. Thanks! |
I think it is broken again in 3.0.0 - jsfiddle to illustrate - http://jsfiddle.net/PRfHB/. If I remove "fade" it works. |
@SergeyBarskiy You used Bootstrap 2.1.0 CSS in your JSFiddle. Quick test showed that it worked with 3.0.0 CSS (you'll need to update the modal's markup according to our docs). |
@juthilo. I updated the fiddle with 3.0 css, js was already 3.0. It does not quite work for me, only dismisses on escape when "fade" is not used. Am I missing something? |
Sorry, missed link to updated fiddle http://jsfiddle.net/PRfHB/1/ |
@SergeyBarskiy Works just fine: http://jsfiddle.net/PRfHB/2/ |
Thank you very much!, Julian I did not have class modal-dialog in my fiddle, that is why it did not work for me. |
@SergeyBarskiy Yeah, as noted in the migration docs, the modal markup has changed a bunch in v3. |
- Adding "tabindex='-1'" to the modal's primary div tag fixes the issue. Additional information can be found at [1] [1] twbs/bootstrap#4663 git-svn-id: https://svn.apache.org/repos/asf/incubator/climate/trunk/rcmet/src/main/ui@1483169 13f79535-47bb-0310-9956-ffa450edef68 Former-commit-id: 0a9e696
ref: twbs/bootstrap#4663 add tabindex=-1
Not working in Microsoft Edge but working in all other browsers |
@GearTheWorld don't necropost on an issue closed 4 years ago. also, 3.x is now in maintenance mode, and and focus is now on getting 4.x stable. if you find it's still an issue using the latest 4.x, please file a new fresh issue. |
Sorry I didn't notice about the years. Ok I will test using 4.x Thank you |
The JavaScript
modal
according to the doc should close when escape is pressed by default:Even setting
keyboard = true
still does not close the modal when escape key is pressed.The text was updated successfully, but these errors were encountered: