File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,11 @@ return $.widget( "ui.dialog", {
273
273
that . _trigger ( "focus" ) ;
274
274
} ) ;
275
275
276
+ // Track the dialog immediately upon openening in case a focus event
277
+ // somehow occurs outside of the dialog before an element inside the
278
+ // dialog is focused (#10152)
279
+ this . _makeFocusTarget ( ) ;
280
+
276
281
this . _trigger ( "open" ) ;
277
282
} ,
278
283
@@ -584,14 +589,18 @@ return $.widget( "ui.dialog", {
584
589
585
590
_trackFocus : function ( ) {
586
591
this . _on ( this . widget ( ) , {
587
- "focusin" : function ( event ) {
588
- this . _untrackInstance ( ) ;
589
- this . _trackingInstances ( ) . unshift ( this ) ;
592
+ focusin : function ( event ) {
593
+ this . _makeFocusTarget ( ) ;
590
594
this . _focusedElement = $ ( event . target ) ;
591
595
}
592
596
} ) ;
593
597
} ,
594
598
599
+ _makeFocusTarget : function ( ) {
600
+ this . _untrackInstance ( ) ;
601
+ this . _trackingInstances ( ) . unshift ( this ) ;
602
+ } ,
603
+
595
604
_untrackInstance : function ( ) {
596
605
var instances = this . _trackingInstances ( ) ,
597
606
exists = $ . inArray ( this , instances ) ;
You can’t perform that action at this time.
0 commit comments