File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2159,14 +2159,18 @@ const MainApp: React.FC = () => {
21592159 const shortcutMap = getShortcutMap ( commands , settings . customShortcuts ) ;
21602160
21612161 const handleKeyDown = ( e : KeyboardEvent ) => {
2162+ const shortcut = formatShortcut ( e ) ;
2163+ const command = shortcutMap . get ( shortcut ) ;
2164+
21622165 const activeEl = document . activeElement ;
2163- if ( activeEl && [ 'INPUT' , 'TEXTAREA' , 'SELECT' ] . includes ( activeEl . tagName ) && activeEl !== commandPaletteInputRef . current ) {
2166+ const isFormElement = activeEl && [ 'INPUT' , 'TEXTAREA' , 'SELECT' ] . includes ( activeEl . tagName ) ;
2167+ const isPaletteInput = activeEl === commandPaletteInputRef . current ;
2168+ const isCommandPaletteToggle = command ?. id === 'toggle-command-palette' ;
2169+
2170+ if ( isFormElement && ! isPaletteInput && ! isCommandPaletteToggle ) {
21642171 return ;
21652172 }
21662173
2167- const shortcut = formatShortcut ( e ) ;
2168- const command = shortcutMap . get ( shortcut ) ;
2169-
21702174 if ( command ) {
21712175 e . preventDefault ( ) ;
21722176 command . action ( ) ;
You can’t perform that action at this time.
0 commit comments