diff --git a/apps/web/src/components/chat/ComposerPendingUserInputPanel.browser.test.tsx b/apps/web/src/components/chat/ComposerPendingUserInputPanel.browser.test.tsx index 40022b45bc845..2bb38a3782f50 100644 --- a/apps/web/src/components/chat/ComposerPendingUserInputPanel.browser.test.tsx +++ b/apps/web/src/components/chat/ComposerPendingUserInputPanel.browser.test.tsx @@ -73,6 +73,18 @@ it.each<{ focus: string; control: ReactNode; toggles: boolean }>([ ), toggles: false, }, + { + focus: "a device screen that takes the key", + control: ( +
event.preventDefault()} + /> + ), + toggles: false, + }, ])( "digit shortcut with focus in $focus toggles an option: $toggles", async ({ control, toggles }) => { diff --git a/apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx b/apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx index 6598b8f1afed2..c637e3b7ef477 100644 --- a/apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx +++ b/apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx @@ -153,7 +153,7 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard( useEffect(() => { if (!activeQuestion || responseDisabled || isCollapsed || backgroundThread) return; const handler = (event: globalThis.KeyboardEvent) => { - if (event.metaKey || event.ctrlKey || event.altKey) return; + if (event.defaultPrevented || event.metaKey || event.ctrlKey || event.altKey) return; const target = event.target; if (isInSideChatPane(target)) return; if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) {