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", {
3535 this . element
3636 . addClass ( "ui-popup" )
3737 this . _close ( ) ;
38-
38+
3939 this . _bind ( this . options . trigger , {
4040 click : function ( event ) {
4141 event . preventDefault ( ) ;
@@ -46,6 +46,10 @@ $.widget( "ui.popup", {
4646 }
4747 } ) ;
4848
49+ this . _bind ( this . element , {
50+ blur : "_close"
51+ } ) ;
52+
4953 this . _bind ( {
5054 keyup : function ( event ) {
5155 if ( event . keyCode == $ . ui . keyCode . ESCAPE && this . element . is ( ":visible" ) ) {
@@ -94,6 +98,10 @@ $.widget( "ui.popup", {
9498 . attr ( "aria-expanded" , true )
9599 . position ( position )
96100 . focus ( ) ;
101+
102+ // take trigger out of tab order to allow shift-tab to skip trigger
103+ this . options . trigger . attr ( "tabindex" , - 1 ) ;
104+
97105 this . open = true ;
98106 this . _trigger ( "open" , event ) ;
99107 } ,
@@ -103,6 +111,9 @@ $.widget( "ui.popup", {
103111 . hide ( )
104112 . attr ( "aria-hidden" , true )
105113 . attr ( "aria-expanded" , false ) ;
114+
115+ this . options . trigger . attr ( "tabindex" , 0 ) ;
116+
106117 this . open = false ;
107118 this . _trigger ( "close" , event ) ;
108119 }
You can’t perform that action at this time.
0 commit comments