#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: |
Description
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 ) {
return;
}
if ( !this._allowInteraction( event ) ) {
event.preventDefault();
this._trackingInstances()[ 0 ]._focusTabbable();
}
}
});
However, it then uses unbind to remove the handler in the _destroyOverlay function:
this.document .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" ); this.document .removeData( "ui-dialog-overlays" );
Here is a reduced test case that demonstrates the problem: https://jsfiddle.net/eu4ua6kj/2/
Change History (2)
comment:1 Changed 16 months ago by Scott González
- Resolution set to fixed
- Status changed from new to closed
comment:2 Changed 16 months ago by scottgonzalez
- Milestone changed from none to 1.12.0
Note: See
TracTickets for help on using
tickets.
Dialog: Fix removal of event listener for modal dialogs
Fixes #13649