UI dialog inheritance
If you create a widget (for example : $.mynamespace.mydialog) that inherits from ui.dialog, there is a bug in the $. Ui.dialog._createOverlay method.
It throw a undefined error on .data("ui-dialog")._focusTabbable() because the data name should be "mynamespace-mydialog".
_createOverlay: function() {
if ( !this.options.modal ) {
return;
}
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 ( !$( event.target ).closest(".ui-dialog").length &&
// TODO: Remove hack when datepicker implements
// the .ui-front logic (#8989)
!$( event.target ).closest(".ui-datepicker").length ) {
event.preventDefault();
$(".ui-dialog:visible:last .ui-dialog-content")
.data("ui-dialog")._focusTabbable();
}
});
}
});
}
this.overlay = $("<div>")
.addClass("ui-widget-overlay ui-front")
.appendTo( this._appendTo() );
this._on( this.overlay, {
mousedown: "_keepFocus"
});
$.ui.dialog.overlayInstances++;
},
Dialog: Don't hard-code widget data key. Fixes #9097 - UI dialog inheritance.