我有问题
unable to get property'_focusTabbable'of undefined or null reference
我正在使用 Jquery-ui-1.10.2.custom.js
在这里我遇到了问题
if ( !$.ui.dialog.overlayInstances ) {
// Prevent use of anchors and inputs.
// We use a delay in case the overlay is created from an
// event that we're going to be cancelling. (#2804)
this._delay(function() {
// Handle .dialog().dialog("close") (#4065)
if ( $.ui.dialog.overlayInstances ) {
this.document.bind( "focusin.dialog", function( event ) {
if ( !that._allowInteraction( event ) ) {
event.preventDefault();
**$(".ui-dialog:visible:last .ui-dialog-content")
.data( widgetFullName )._focusTabbable();**
}
});
}
});
}
最佳答案
当您打开一个对话框,然后在此对话框的操作按钮中调用打开第二个对话框的方法时,就会出现此错误。当您尝试关闭第二个对话框时,会出现该错误。
为防止发生这种情况,请立即关闭第一个对话框,然后调用第二个对话框。
$('#dialog1').dialog({
buttons: {
'No': function () {
$(this).dialog('close')
},
'Yes': function () {
// This works
$(this).dialog('close');
// Open second dialog
OpenSecondDialog()
// This doesn't work. A bug will arise when attempting to close the second dialog
$(this).dialog('close');
}
}
});
关于jquery-ui - jQuery UI 焦点问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37185031/