File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 128128                    break ; 
129129                case  "enter" :
130130                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, 
134132                    // but they also close the menu 
135133                    // this behavior is identical between both the WAI example, and GitHub's 
136134                    setTimeout ( function ( )  { 
137135                        closeMenu ( ) ; 
138136                    } ,  100 ) ; 
139137                    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 ; 
140147                case  "home" :
141148                case  "pageup" :
142149                    // home: focus first menu item. 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments