Skip to content

Commit ceca0e2

Browse files
committed
fix(app): skip key handlers during IME composition in question dock
The custom answer textarea in SessionQuestionDock submits on Enter without checking whether the browser is in an IME composition session. This causes CJK users' composition-confirm Enter to be treated as a form submit. Add the standard isComposing/keyCode-229 early return to both the textarea onKeyDown and the parent nav handler, matching the pattern already used in prompt-input.tsx and line-comment.tsx. Closes anomalyco#20850
1 parent 500dcfc commit ceca0e2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎packages/app/src/pages/session/composer/session-question-dock.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
303303

304304
const nav = (event: KeyboardEvent) => {
305305
if (event.defaultPrevented) return
306+
if (event.isComposing || event.keyCode === 229) return
306307

307308
if (event.key === "Escape") {
308309
event.preventDefault()
@@ -543,6 +544,7 @@ export const SessionQuestionDock: Component<{ request: QuestionRequest; onSubmit
543544
rows={1}
544545
disabled={sending()}
545546
onKeyDown={(e) => {
547+
if (e.isComposing || e.keyCode === 229) return
546548
if (e.key === "Escape") {
547549
e.preventDefault()
548550
setStore("editing", false)

0 commit comments

Comments
 (0)