fix: prevent IME composition line break in checkbox list items#95
Merged
fix: prevent IME composition line break in checkbox list items#95
Conversation
Extend imeCompositionGuard to handle checkListItem blocks where contenteditable="false" checkbox wrapper confuses ProseMirror's DOM-to-model position mapping during composition. Key changes: - Add document snapshot restore mechanism: save pre-composition state and restore after flush, inserting only committed text via queueMicrotask (before paint, no visual glitch) - Add insertParagraph to blocked input types alongside insertLineBreak - Allow restore transactions through filterTransaction via meta tag - Improve type safety (replace any with proper ProseMirror types) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
contenteditable="false"checkbox wrapper confuses ProseMirror's DOM-to-model position mapping during IME compositionqueueMicrotask(before paint, no visual glitch)insertParagraphto blocked input types alongsideinsertLineBreakfilterTransactionvia meta tagRoot cause
For checkListItem blocks, ProseMirror's composition flush produces incorrect transactions because the
contenteditable="false"wrapper around the checkbox confuses DOM-to-model position mapping. This results in:Test plan
🤖 Generated with Claude Code