Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13649 closed bug (fixed)

Modal dialog removes all document focusin handlers in _destroyOverlay

Reported by: RandScullard Owned by:
Priority: minor Milestone: 1.12.0
Component: ui.dialog Version: 1.11.4
Keywords: Cc:
Blocked by: Blocking:


The dialog widget uses this._on to add a focusin event handler at the document level in the _createOverlay function:

this._on( this.document, {
	focusin: function( event ) {
		if ( isOpening ) {

		if ( !this._allowInteraction( event ) ) {
			this._trackingInstances()[ 0 ]._focusTabbable();

However, it then uses unbind to remove the handler in the _destroyOverlay function:

	.unbind( "focusin" )
	.removeData( "ui-dialog-overlays" );

As a result, it removes all focusin handlers at the document level, rather than just its own. It seems that it should use this._off instead:

this._off( this.document, "focusin" );
	.removeData( "ui-dialog-overlays" );

Here is a reduced test case that demonstrates the problem:

Change History (2)

comment:1 Changed 8 years ago by Scott González

Resolution: fixed
Status: newclosed

Dialog: Fix removal of event listener for modal dialogs

Fixes #13649

Changeset: 62446d957efb69cd53015919edf71501fcbd2599

comment:2 Changed 8 years ago by Scott González

Milestone: none1.12.0
Note: See TracTickets for help on using tickets.