File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 128
128
break ;
129
129
case "enter" :
130
130
case "return" :
131
- case "space" :
132
- case " " :
133
- // enter, return, and space have the default browser behavior,
131
+ // enter and return have the default browser behavior,
134
132
// but they also close the menu
135
133
// this behavior is identical between both the WAI example, and GitHub's
136
134
setTimeout ( function ( ) {
137
135
closeMenu ( ) ;
138
136
} , 100 ) ;
139
137
break ;
138
+ case "space" :
139
+ case " " :
140
+ // space closes the menu, but does not engage default behavior,
141
+ // which would be to scroll the page
142
+ // this behavior is identical between both the WAI example, and GitHub's
143
+ closeMenu ( ) ;
144
+ e . preventDefault ( ) ;
145
+ e . stopPropagation ( ) ;
146
+ break ;
140
147
case "home" :
141
148
case "pageup" :
142
149
// home: focus first menu item.
You can’t perform that action at this time.
0 commit comments