File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -520,24 +520,33 @@ const KeyCode = {
520520
521521 shouldIgnoreKeyboardEvent : function shouldIgnoreKeyboardEvent (
522522 e : KeyboardEvent ,
523+ options ?: {
524+ checkEditable ?: boolean ;
525+ checkComposing ?: boolean ;
526+ } ,
523527 ) {
524528 const target = e . target ;
529+ const { checkEditable = true , checkComposing = true } = options || { } ;
525530
526531 if ( ! ( target instanceof HTMLElement ) ) {
527532 return false ;
528533 }
529534
530535 const tagName = target . tagName ;
531536 if (
532- e . isComposing ||
533- tagName === 'INPUT' ||
534- tagName === 'TEXTAREA' ||
535- tagName === 'SELECT' ||
536- target . isContentEditable
537+ checkEditable &&
538+ ( tagName === 'INPUT' ||
539+ tagName === 'TEXTAREA' ||
540+ tagName === 'SELECT' ||
541+ target . isContentEditable )
537542 ) {
538543 return true ;
539544 }
540545
546+ if ( checkComposing && e . isComposing ) {
547+ return true ;
548+ }
549+
541550 return false ;
542551 } ,
543552} ;
You can’t perform that action at this time.
0 commit comments