File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2161,14 +2161,18 @@ const MainApp: React.FC = () => {
21612161 const shortcutMap = getShortcutMap ( commands , settings . customShortcuts ) ;
21622162
21632163 const handleKeyDown = ( e : KeyboardEvent ) => {
2164+ const shortcut = formatShortcut ( e ) ;
2165+ const command = shortcutMap . get ( shortcut ) ;
2166+
21642167 const activeEl = document . activeElement ;
2165- if ( activeEl && [ 'INPUT' , 'TEXTAREA' , 'SELECT' ] . includes ( activeEl . tagName ) && activeEl !== commandPaletteInputRef . current ) {
2168+ const isFormElement = activeEl && [ 'INPUT' , 'TEXTAREA' , 'SELECT' ] . includes ( activeEl . tagName ) ;
2169+ const isPaletteInput = activeEl === commandPaletteInputRef . current ;
2170+ const isCommandPaletteToggle = command ?. id === 'toggle-command-palette' ;
2171+
2172+ if ( isFormElement && ! isPaletteInput && ! isCommandPaletteToggle ) {
21662173 return ;
21672174 }
21682175
2169- const shortcut = formatShortcut ( e ) ;
2170- const command = shortcutMap . get ( shortcut ) ;
2171-
21722176 if ( command ) {
21732177 e . preventDefault ( ) ;
21742178 command . action ( ) ;
You can’t perform that action at this time.
0 commit comments