File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ $.widget( "ui.popup", {
35
35
this . element
36
36
. addClass ( "ui-popup" )
37
37
this . _close ( ) ;
38
-
38
+
39
39
this . _bind ( this . options . trigger , {
40
40
click : function ( event ) {
41
41
event . preventDefault ( ) ;
@@ -46,6 +46,10 @@ $.widget( "ui.popup", {
46
46
}
47
47
} ) ;
48
48
49
+ this . _bind ( this . element , {
50
+ blur : "_close"
51
+ } ) ;
52
+
49
53
this . _bind ( {
50
54
keyup : function ( event ) {
51
55
if ( event . keyCode == $ . ui . keyCode . ESCAPE && this . element . is ( ":visible" ) ) {
@@ -94,6 +98,10 @@ $.widget( "ui.popup", {
94
98
. attr ( "aria-expanded" , true )
95
99
. position ( position )
96
100
. focus ( ) ;
101
+
102
+ // take trigger out of tab order to allow shift-tab to skip trigger
103
+ this . options . trigger . attr ( "tabindex" , - 1 ) ;
104
+
97
105
this . open = true ;
98
106
this . _trigger ( "open" , event ) ;
99
107
} ,
@@ -103,6 +111,9 @@ $.widget( "ui.popup", {
103
111
. hide ( )
104
112
. attr ( "aria-hidden" , true )
105
113
. attr ( "aria-expanded" , false ) ;
114
+
115
+ this . options . trigger . attr ( "tabindex" , 0 ) ;
116
+
106
117
this . open = false ;
107
118
this . _trigger ( "close" , event ) ;
108
119
}
You can’t perform that action at this time.
0 commit comments