且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Jquery Ui Datepicker 月/年下拉列表在最新的 Firefox 中的弹出窗口中不起作用

更新时间:2022-03-23 22:25:32

这是因为模式强制将注意力集中在自身上.这是一个解决方案,如此处所述.将以下脚本添加到您的 js 文件中.就是这样.

This is because the modal enforces focus on itself. Here is a solution for this as mentioned here . Add the below script to your js file. That's it.

jsfiddle:http://jsfiddle.net/surjithctly/93eTU/16/

参考:Twitter 引导程序多模态错误

// Since confModal is essentially a nested modal it's enforceFocus method
// must be no-op'd or the following error results 
// "Uncaught RangeError: Maximum call stack size exceeded"
// But then when the nested modal is hidden we reset modal.enforceFocus
var enforceModalFocusFn = $.fn.modal.Constructor.prototype.enforceFocus;

$.fn.modal.Constructor.prototype.enforceFocus = function() {};

$confModal.on('hidden', function() {
    $.fn.modal.Constructor.prototype.enforceFocus = enforceModalFocusFn;
});

$confModal.modal({ backdrop : false });

对于 Bootstrap 4:

replace : $.fn.modal.Constructor.prototype.enforceFocus
By: $.fn.modal.Constructor.prototype._enforceFocus