Skip to content

Commit 12a1346

Browse files
committed
chore: adjust
1 parent db5b908 commit 12a1346

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/KeyCode.ts

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -518,35 +518,24 @@ const KeyCode = {
518518
}
519519
},
520520

521-
shouldIgnoreKeyboardEvent: function shouldIgnoreKeyboardEvent(
522-
e: KeyboardEvent,
523-
options?: {
524-
checkEditable?: boolean;
525-
checkComposing?: boolean;
526-
},
527-
) {
521+
isEditableTarget: function isEditableTarget(e: KeyboardEvent) {
528522
const target = e.target;
529-
const { checkEditable = true, checkComposing = true } = options || {};
530523

531524
if (!(target instanceof HTMLElement)) {
532525
return false;
533526
}
534527

535528
const tagName = target.tagName;
536529
if (
537-
checkEditable &&
538-
(tagName === 'INPUT' ||
539-
tagName === 'TEXTAREA' ||
540-
tagName === 'SELECT' ||
541-
target.isContentEditable)
530+
e.isComposing ||
531+
tagName === 'INPUT' ||
532+
tagName === 'TEXTAREA' ||
533+
tagName === 'SELECT' ||
534+
target.isContentEditable
542535
) {
543536
return true;
544537
}
545538

546-
if (checkComposing && e.isComposing) {
547-
return true;
548-
}
549-
550539
return false;
551540
},
552541
};

0 commit comments

Comments
 (0)