Re-apply IME input fix from #1404 (lost from develop by a force-push) - #1685
Open
KohtaHorike wants to merge 1 commit into
Open
Re-apply IME input fix from #1404 (lost from develop by a force-push)#1685KohtaHorike wants to merge 1 commit into
KohtaHorike wants to merge 1 commit into
Conversation
…E input is confirmed.
Merged
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.
Summary
This re-applies the fix from #1404, which was merged but subsequently lost from
develophistory, so it never shipped in any release.The bug it fixes
When editing content that contains styled
<span>elements (e.g.<span style="font-weight: 700;">…</span>pasted from Word or another page), using an IME (Japanese/Chinese/Korean input) and pressing Backspace/Enter/Delete makes those spans lose their styling.Root cause: the Chrome-span cleanup relies on a keydown/keyup pair —
keydown(keyCode 8/13/46) flags existing spans withdata-tbw-flag, thenkeyupunwraps any unflagged span. During IME composition, keydown fires withkeyCode === 229("IME processing"), so existing spans never get flagged. When the composition ends (e.g. cancelled with Backspace),compositionendclears the composition guard and the subsequentkeyup(keyCode 8) unwraps every span in the editor, destroying legitimate inline-styled spans.The fix adds
keyCode === 229to the keydown condition so spans are flagged before the cleanup runs.Why this PR exists although #1404 shows as "Merged"
#1404 was merged into
developon 2025-01-29 at 16:32 UTC as merge commit3c9fc78b(parents:3ff8d569+ fix commit09203990). However:7d56742fwas pushed todevelopwith parent3ff8d569— not3c9fc78b— so the merge commit and the fix commit were both dropped from the branch (presumably an accidental force-push from a local clone that predated the merge).developcontains it, while Fix IME input #1404 still displays as "Merged".You can verify: comparing
develop...3c9fc78bshows exactly those two commits missing fromdevelop.This PR cherry-picks the original commit
09203990, preserving authorship credit for @hidemikimura.How to reproduce
<span style="font-weight: 700;">bold text</span>.