File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -59,18 +59,14 @@ export default function Keybinding(props: KeybindingProps) {
5959
6060 const onKeyEvent = useCallback (
6161 ( e : KeyboardEvent ) => {
62- // is actually a KeyboardEvent
63- if ( preventDefault ) e . preventDefault ( ) ;
64- if ( stopPropagation ) e . stopPropagation ( ) ;
65-
6662 const target = e . target as HTMLElement | null ;
6763
68- if ( target ) {
64+ if ( target != null ) {
6965 let canDispatch = true ;
7066
7167 if (
7268 preventInputConflict &&
73- TARGETS_BLACKLIST . indexOf ( target . tagName . toLowerCase ( ) ) > - 1
69+ TARGETS_BLACKLIST . includes ( target . tagName . toLowerCase ( ) )
7470 ) {
7571 canDispatch = false ;
7672 }
@@ -79,7 +75,11 @@ export default function Keybinding(props: KeybindingProps) {
7975 canDispatch = false ;
8076 }
8177
82- if ( canDispatch ) onKey ( e ) ;
78+ if ( canDispatch ) {
79+ if ( preventDefault ) e . preventDefault ( ) ;
80+ if ( stopPropagation ) e . stopPropagation ( ) ;
81+ onKey ( e ) ;
82+ }
8383 }
8484 } ,
8585 [
You can’t perform that action at this time.
0 commit comments