fix: the first-letter issue when using IME input#151
Open
vincentdchan wants to merge 1 commit intoslab:mainfrom
Open
fix: the first-letter issue when using IME input#151vincentdchan wants to merge 1 commit intoslab:mainfrom
vincentdchan wants to merge 1 commit intoslab:mainfrom
Conversation
work-2025
pushed a commit
to work-2025/parchment
that referenced
this pull request
Apr 3, 2025
work-2025
pushed a commit
to work-2025/parchment
that referenced
this pull request
Apr 3, 2025
work-2025
pushed a commit
to work-2025/parchment
that referenced
this pull request
Apr 3, 2025
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.
The problem
This PR is trying to fix the issue of IME in quill editor: slab/quill#4449
We found that if we want to fix the collaborative editing issue, we need to disable
batchStartandbatchEndin the handlers.https://github.com/slab/quill/blob/b213e1073bac1478649f26e3c0dad50ad0eb2a49/packages/quill/src/core/composition.ts#L42
Afterward, we found that the first letter from the IME input remains when typing on an empty line.
This PR fixes this issue.
Root cause
We found that this is caused by Quill re-inserting the child element into the parent, even when the element is already in the correct position, which causes the browser to cancel the composition.
The solution
Looking at the diff code, I’m not sure why it was written that way originally. However, it seems there is an issue with the logic, and I have made corrections here. After the correction, the above-mentioned issue is resolved