The month selected in datepicker does not work in FireFox if it is in a bootable modal format.
<button class="btn" id="btn">Click Me</button> <div class="modal hide" id="modal" tabindex="-1"> <div class="modal-body"> <input type="text" id="datepicker" /> </div> </div>
JavaScript:
$("#datepicker").datepicker({"changeMonth": true}); $('#btn').click(function() { $("#modal").modal('show'); });
Below is an example: http://jsfiddle.net/nKXF2/
I found a problem with simitilar twitter-bootstrap github: https://github.com/twbs/bootstrap/issues/5979
I found two fixes for this error:
1: tabindex attr div.modal, . , , - , IE ( ) , .
Fix2: : http://jsfiddle.net/nKXF2/1/. , , , .
$('#modal').on('show', function () { $.fn.modal.Constructor.prototype.enforceFocus = function () { }; });
, .
, , . . , Firefox, .: P
First, try to detect only the Firefox browser.
if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1) { $.fn.modal.Constructor.prototype.enforceFocus = function (){}; }