GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Safari: CJK IME composition is aborted mid-input in web app prompt input · Issue #38674 · anomalyco/opencode

Safari: CJK IME composition is aborted mid-input in web app prompt input #38674

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Safari: CJK IME composition is aborted mid-input in web app prompt input#38674
Copy link
Assignees
Brendonovich

Description

@powoct
powoct
opened on Jul 24, 2026
Issue body actions

Description

In the web app prompt input (packages/app/src/components/prompt-input.tsx), typing with a CJK IME in Safari gets cut off mid-composition: after a few keystrokes the half-composed text (raw pinyin / kana) is committed as plain text and the composition ends.

Root cause: the prompt input is a contenteditable that round-trips DOM -> state -> DOM on every input event (handleInput -> prompt.set(...) -> effect -> renderEditorWithCursor()). Safari aborts an active IME composition whenever the DOM or selection is mutated programmatically, and the existing guards don't hold there:

  • The effect guard if (composing()) return fails because Safari fires the first input event before compositionstart, so composing() is still false at that point (Chrome fires them in the opposite order).
  • The mirror.input flag only skips one write-back round; when isNormalizedEditor() is false (common mid-composition) renderEditorWithCursor() still rewrites the DOM.

Japanese IMEs that confirm bunsetsu-by-bunsetsu also fire compositionend + a new compositionstart mid-sentence; a rewrite landing in that gap cuts off the remaining segments the same way.

Related: #35746 covers the confirm-Enter mis-submit side. The same Safari event order breaks the isImeComposing guard in this input too: Safari fires compositionend before the confirming Enter keydown, so that event has isComposing === false and keyCode === 13 and none of the guard conditions match.

The standard approach (ProseMirror / CodeMirror / Lexical) is to freeze DOM->state->DOM syncing entirely during composition and do a single sync on compositionend. I have a patch for both problems and would like to submit a PR.

Plugins

No response

OpenCode version

v1.18.4 (code paths verified on main @ c9db6e9)

Steps to reproduce

  1. Open the opencode web app in Safari on macOS.
  2. Focus the prompt input and enable a Chinese pinyin or Japanese IME.
  3. Type a long phrase continuously, e.g. zhongwenshurufaceshi or きょうはいいてんきですね.
  4. The composition is aborted partway and half-composed text is committed. Pressing Enter to confirm a candidate also submits the message.

Not reproducible in Chrome (there compositionstart precedes the first input, and the confirming Enter keydown arrives with isComposing=true / keyCode=229 before compositionend).

Screenshot and/or share link

No response

Operating System

macOS (Safari)

Terminal

No response

Activity

  1. github-actions
    assigned
    Brendonovich
    on Jul 24, 2026
  2. anyingiit commented on Aug 25, 2026

    @anyingiit
    anyingiit
    on Aug 25, 2026
    More actions

    Environment

    • OS: macOS 26.6 (25G72)
    • OpenCode Web: served by OpenCode server 1.18.23
    • Browser: Safari
    • IME: macOS built-in Simplified Chinese Pinyin

    Reproduction

    1. Open a new browser tab pointing to the OpenCode web app.
    2. Focus the v2 prompt input and enable the Chinese IME.
    3. Start typing continuously.

    Expected: Pinyin composes normally and can be confirmed.

    Actual: All letters except the last one are committed as plain English characters immediately; only the final keystroke remains in the composition. Chrome on the same machine does not exhibit this.

  3. Tarquinen commented on Oct 20, 2026

    @Tarquinen
    Tarquinen
    on Oct 20, 2026
    Member
    More actions

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

  4. Tarquinen
    closed this as not plannedon Oct 20, 2026
  5. Mirac1eSky
    added a commit that references this issue on Oct 26, 2026

    fix(app): keep the composer editor inert during IME composition

    f59b00c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Brendonovich
    Brendonovich

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.