更新时间:2022-02-01 22:22:07
这是因为模态强加了自己的注意力。以下是此处的解决方案。将以下脚本添加到您的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 /
jsfiddle: http://jsfiddle.net/surjithctly/93eTU/16/
// 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 });