Skip to content

fix: ignore Enter during IME composition in command palette#184

Open
greymoth-jp wants to merge 1 commit into
deta:mainfrom
greymoth-jp:fix/teletype-ime-composition
Open

fix: ignore Enter during IME composition in command palette#184
greymoth-jp wants to merge 1 commit into
deta:mainfrom
greymoth-jp:fix/teletype-ime-composition

Conversation

@greymoth-jp

Copy link
Copy Markdown

With a Japanese, Chinese or Korean IME, the first Enter confirms the active composition candidate instead of submitting. In TeletypeCore, handleInputKey ran callAction on e.key === 'Enter' && !e.shiftKey, so confirming a candidate fired the action (or the fallback action) on a half-typed query.

I added !e.isComposing to that condition, so Enter only acts once composition has ended. A normal Enter is unaffected.

Repro: set the OS to a Japanese IME, open the command palette, type a query such as けんさく and press Enter to pick a candidate.

  • Before: the action runs on the unfinished text.
  • After: that Enter confirms the candidate, and a second Enter runs the action.

In TeletypeCore, the Enter handler ran callAction as soon as Enter was
pressed. During IME input (Japanese/Chinese/Korean) the first Enter only
confirms the composition candidate, so the command palette fired the action
on a half-typed query. Guard the handler with !e.isComposing so Enter acts
only after composition has ended.

Signed-off-by: greymoth <246701683+greymoth-jp@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant