Skip to content

fix(windows): commit IME composition before blur - #296

Draft
houko wants to merge 1 commit into
mainfrom
fix/windows-ime-commit-on-blur
Draft

houko wants to merge 1 commit into
mainfrom
fix/windows-ime-commit-on-blur

Conversation

@houko

@houko houko commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Windows text inputs now commit an active IME composition before focus leaves the field, as Windows' own edit controls do. Before, every way the focus left a composing field cancelled the composition and dropped what the user had composed: a click on another field, the app focusing another view or blurring the field, a modal or alert covering it, the field turning disabled or hidden, UI Automation moving the focus. Now setFocus completes the composition for all of them, so the committed OnChange and OnCompositionChange{Composing:false} arrive before OnBlur. A click inside the composing field itself still commits it before the caret moves, as it did before.

TestTestHostCommitsCompositionBeforeBlur composes in a field through the IME and then clicks another field, focuses another field from the app (Ref.Focus), or clicks inside the composing field, and checks the events: committed text, composition end, then blur (no blur for the click inside). Machines without an input method skip it.

Validation:

  • go build ./..., go tool nsgo check -target all, GOOS=windows vet for amd64, 386 and arm64
  • go tool nsgo test ./internal/platform/field, go tool nsgo test -run '^TestInputSelectionKeysAndComposition$' ./core, go tool nsgo test -run 'Layer|Skills|Doc' .
  • Windows 11 with Microsoft Pinyin, in the interactive session, three runs each: on main's input.go the click-away and app cases fail (focus,composition,end,blur, nothing committed); with this change all three cases pass. The other Windows focus, field and modal tests fail or pass the same with and without the change.

@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation Windows size/S macOS iOS Linux cli ci size/M and removed size/S labels Nov 15, 2026
@houko
houko force-pushed the fix/windows-ime-commit-on-blur branch from 3e18a53 to 773f793 Compare November 16, 2026 04:15
@github-actions github-actions Bot removed the size/S label Nov 16, 2026

This branch has not been deployed

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

Labels

bug Something isn't working ci cli documentation Improvements or additions to documentation iOS Linux macOS size/M Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant