File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 28
28
return allItems [ allItems . length - 1 ] ;
29
29
}
30
30
function closeMenu ( ) {
31
+ if ( this === backdrop ) {
32
+ var rustdoc = document . querySelector ( ".rustdoc" ) ;
33
+ if ( rustdoc ) {
34
+ rustdoc . focus ( ) ;
35
+ } else {
36
+ document . documentElement . focus ( ) ;
37
+ }
38
+ } else if ( currentMenu . querySelector ( ".pure-menu-link:focus" ) ) {
39
+ currentMenu . firstElementChild . focus ( ) ;
40
+ }
31
41
currentMenu . className = currentMenu . className . replace ( "pure-menu-active" , "" ) ;
32
42
currentMenu = null ;
33
43
backdrop . style . display = "none" ;
113
123
// but is a rationalization of GitHub's behavior: we don't want users who know how to
114
124
// use tab and enter, but don't know that they can close menus with Escape,
115
125
// to find themselves completely trapped in the menu
116
- currentMenu . firstElementChild . focus ( ) ;
117
126
closeMenu ( ) ;
118
127
e . preventDefault ( ) ;
119
128
e . stopPropagation ( ) ;
You can’t perform that action at this time.
0 commit comments