File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/Common/Hooks/UseRegisterShortcut Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -121,15 +121,20 @@ const UseRegisterShortcutProvider = ({
121121 }
122122
123123 if (
124- ignoredTags . map ( ( tag ) => tag . toUpperCase ( ) ) . indexOf ( ( event . target as HTMLElement ) . tagName . toUpperCase ( ) ) >
124+ ignoredTags . map ( ( tag ) => tag . toUpperCase ( ) ) . indexOf ( ( event . target as HTMLElement ) . tagName ? .toUpperCase ( ) ) >
125125 - 1 ||
126126 ( event . target as HTMLElement ) ?. role === 'textbox' ||
127127 disableShortcutsRef . current
128128 ) {
129129 return
130130 }
131131
132- keysDownRef . current . add ( event . key . toUpperCase ( ) as Uppercase < string > )
132+ // NOTE: in case of custom events generated by password managers autofill, the event.key is not set
133+ if ( ! event . key ) {
134+ return
135+ }
136+
137+ keysDownRef . current . add ( event . key ?. toUpperCase ( ) as Uppercase < string > )
133138
134139 if ( event . ctrlKey ) {
135140 keysDownRef . current . add ( 'CONTROL' )
You can’t perform that action at this time.
0 commit comments