Pressing Enter to confirm IME input submits the prompt composer

Open Beginner friendly
#38 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
html, javascript
Domain
frontend

Research direction

Start with the keydown handler at public/index.html:1838-1842 and check for similar Enter-to-submit handlers in public/. The issue describes the IME signals to handle: e.isComposing and e.keyCode === 229. Confirm the done criteria by testing IME candidate confirmation, plain Enter submission, and Shift+Enter newline behavior.

Written by the indexing model from the issue text.

Description

bug good first issue

The composer's keydown handler (public/index.html:1838-1842) submits on any Enter without Shift:

if (e.key !== "Enter" || e.shiftKey) return;
e.preventDefault();
realGenerate();

Users typing Japanese, Chinese or Korean press Enter to confirm a candidate from the input method. While the IME is composing, that keydown still has key === "Enter". So the brief is sent half-written, and the composed text never lands in the box.

Expected: Enter submits only when no composition is active.

Fix direction: return early when e.isComposing is true. Also check e.keyCode === 229, because Safari reports it for IME keydowns. No other Enter-to-submit handler in public/ has this check, so search for similar handlers (director-workspace.js:583 uses Ctrl/Cmd+Enter and is fine).

Done when you can type and confirm a Japanese phrase with the macOS or Windows IME, or a browser IME extension, without triggering generation. A plain Enter still submits, and Shift+Enter still adds a newline.

Dominant language
HTML
Stars
1.2k
Forks
109
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blixvip/NullMotion

All issues in blixvip/NullMotion

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.