Jquery Ui Datepicker月/年下拉菜单在最新的Firefox中无法弹出 [英] Jquery Ui Datepicker month/year dropdown is not working in popup in latest firefox

查看:274
本文介绍了Jquery Ui Datepicker月/年下拉菜单在最新的Firefox中无法弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知何故,我的jQuery UI Datepicker月/年下拉菜单不能在最新的Firefox中的任何弹出窗口中运行。

Somehow my jQuery UI Datepicker Month/Year Dropdown not working in any popup in latest firefox .

当我点击月或年下拉菜单时, t出现。

When I click on Month or Year Dropdown, the options list doesn't appears.

这是我的Popup& DatePicker代码:

Here is my Popup & Datepicker Code:

$( "#dialog-form" ).dialog({
    modal: true
});

$("#datepicker").datepicker({
    changeMonth: true,
    changeYear: true
});

我还在JSfiddle上准备了一个演示:

I prepared a demo on JSfiddle too:

http://jsfiddle.net/469zV/2/

推荐答案

这是因为模态强加了自己的注意力。以下是此处的解决方案。将以下脚本添加到您的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/

参考: Twitter bootstrap多模态错误

// 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 });

这篇关于Jquery Ui Datepicker月/年下拉菜单在最新的Firefox中无法弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆