bootstrap-modal - FF enforceFocus issue
Hi there,
the website we're developing uses bootstrap to open modals, where users provide their personal information. One of the input fields is a calendar field, which opens up a floating div - now that's there an issue happens: one of the fields in that div is a select, which can't be used, as the options won't display. The issue happens in FF and it doesn't happen in Chrome - I've tracked it down to enforceFocus function (it is called twice with true + false in FF, once with false in Chrome) - so what actually happens is that options do display, but then the focus is being called on select, which hides the options.
Here's the fiddle to replicate the issue: http://jsfiddle.net/Sykwv/1/
Cheers!
you need to have your calendar be a child of the modal – that's just how it works at this point for accessibility reasons
I think this is an issue that should be reopened.
Here is a minified example: http://jsfiddle.net/nKXF2/
The month select in the datepicker doesn't work in FireFox.
Notice that If you remove the tabindex attr in div.modal, the month select works just fine.
I'm also posting another quick fix for this issue: http://jsfiddle.net/nKXF2/1/ by overriding the enforceFocus function.
Is removing tabindex or overriding the enforceFocus function the best solution?
I don't see the issue with http://jsfiddle.net/nKXF2/ on Firefox 34.
Hi @nikolas!
You appear to have posted a live example (http://fiddle.jshell.net/nKXF2/show/light/), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:
- line 49, column 1: E032:
.modal-bodymust be a child of.modal-content - line 47, column 3: W007: Found one or more
<button>s missing atypeattribute. - line 18, column 7: W013: Bootstrap version might be outdated. Latest version is at least 3.3.1 ; saw what appears to be usage of Bootstrap 2.1.0
- line 22, column 7: W013: Bootstrap version might be outdated. Latest version is at least 3.3.1 ; saw what appears to be usage of Bootstrap 2.3.2
You'll need to fix these errors and post a revised example before we can proceed further. Thanks!
(Please note that this is a fully automated comment.)
yes acarrau perfect - I know write $('#modal').removeAttr('tabindex'); behind each modal call!