Skip to content

Commit 5467d11

Browse files
authored
fix(web): prevent number-key shortcuts from hijacking input in focused editor (#1810)
1 parent 1f4a3f6 commit 5467d11

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
100100
if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) {
101101
return;
102102
}
103-
if (target instanceof HTMLElement && target.isContentEditable) {
103+
if (
104+
target instanceof HTMLElement &&
105+
target.closest('[contenteditable]:not([contenteditable="false"])')
106+
) {
104107
return;
105108
}
106109
const digit = Number.parseInt(event.key, 10);

0 commit comments

Comments
 (0)