From 33db6d784c6ec99b8e25cfa6e4a28e39bca6e942 Mon Sep 17 00:00:00 2001 From: Illia Panasenko Date: Wed, 18 Nov 2026 08:21:01 +0100 Subject: [PATCH] fix(web): keys typed into a simulator no longer answer a pending question --- .../ComposerPendingUserInputPanel.browser.test.tsx | 12 ++++++++++++ .../chat/ComposerPendingUserInputPanel.tsx | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) 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) {