File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export function useMenuItem<MenuItemElement extends HTMLElement>({
82
82
83
83
const onKeyDown = ( event : KeyboardEvent < MenuItemElement > ) => {
84
84
const targetKey = normalizeKey ( event ) ;
85
- const closeActionKeys = [ 'Enter' , ' ' , 'Escape' ] ;
85
+ const closeActionKeys = [ 'Enter' , ' ' ] ;
86
86
87
87
const isArrowPress = targetKey . indexOf ( 'Arrow' ) === 0 ;
88
88
const isActionKeyPress = targetKey === 'Enter' || targetKey === ' ' ;
@@ -114,10 +114,7 @@ export function useMenuItem<MenuItemElement extends HTMLElement>({
114
114
menuItemRef . current ?. click ( ) ;
115
115
}
116
116
117
- if (
118
- ( ! formElement && closeActionKeys . indexOf ( targetKey ) > - 1 ) ||
119
- ( formElement && targetKey === 'Escape' )
120
- ) {
117
+ if ( ! formElement && closeActionKeys . indexOf ( targetKey ) > - 1 ) {
121
118
focusTrigger ( ) ;
122
119
}
123
120
} ;
You can’t perform that action at this time.
0 commit comments