fix: dead-key layouts cannot type the apostrophe and the composition space skips the word - #305
Open
Ukly0 wants to merge 2 commits into
Open
fix: dead-key layouts cannot type the apostrophe and the composition space skips the word#305Ukly0 wants to merge 2 commits into
Ukly0 wants to merge 2 commits into
Conversation
…l, Nordic...) Keydown handling assumed a plain US-English keyboard, so any layout where ' ^ ~ etc. are dead keys could not type those characters: browsers report the dead key as key='Dead' (which entered the input as literal 'Dead' text) and the composition-terminating Space was treated as a real word separator, skipping/hiding the word being typed. - Dead keys (key='Dead') are dropped from the keydown pipeline; the actual character is delivered by the OS composition via the existing hidden input's input event (layout-agnostic) - The Space that terminates a dead-key composition is swallowed so it is not treated as a word separator - Also covers browsers that report dead keys as their base character: a pending-composition state is confirmed/cleared when a real character lands in the hidden input, so plain English layouts are unaffected - Unit tests cover both reporting models and the no-regression case
|
@Ukly0 is attempting to deploy a commit to the zyronon's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Closing for now — this fix needs further verification on real devices/setups before being submitted. Will reopen once verified. Thanks! (中文:暂时关闭,修复还需在真实设备上进一步验证,之后再重新提交。谢谢!) |
Owner
|
ok |
…macOS) - Drop key='Dead' keydowns: the real character is delivered by the OS via the hidden input's input event (layout-agnostic) - Swallow the Space that terminates a dead-key composition (both the key='Dead' path and the composition-event path while isComposing) - Skip composition input events so the reset sentinel space is not re-dispatched as a phantom character (Firefox fires input after compositionend) - Show the 'switch to English' warning only for real CJK IME output, so dead-key layouts (es, US-Intl...) no longer get a spurious warning - Unit tests: dead-key swallow, English no-regression, state reset
Author
|
Verified on dead-key layouts (Chromium on Linux, Firefox on macOS); reopening. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On layouts with dead keys (Spanish, French, US-International, Nordic...),
an apostrophe requires pressing the dead key and then Space, but that
composition Space is consumed by the OS — not a real separator — yet it
was treated as one, skipping the word being typed. Chromium/Gecko also
report the dead key as
key='Dead', which ended up in the input literally.Changes:
key='Dead'keydowns; the actual character is delivered bythe OS composition through the hidden input's input event
key='Dead'path and the composition-events path while composing)CJK/IME output, so dead-key layouts stop getting spammed by it
no-regression and state reset
Fixes #304