Ticket #9097 (closed bug: fixed)

Opened 19 months ago

Last modified 17 months ago

UI dialog inheritance

Reported by: Boucman Owned by:
Priority: minor Milestone: 1.10.2
Component: ui.dialog Version: 1.10.1
Keywords: Cc:
Blocking: Blocked by:

Description

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++;
	},

Change History

comment:1 Changed 19 months ago by Scott González

  • Status changed from new to closed
  • Resolution set to fixed

Dialog: Don't hard-code widget data key. Fixes #9097 - UI dialog inheritance.

Changeset: 5e1b8dc71a72d5753a95c49c844857b91fbdbade

comment:2 Changed 19 months ago by scott.gonzalez

  • Milestone changed from none to 1.10.2

comment:3 Changed 17 months ago by scott.gonzalez

#9241 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.