Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the first-letter issue when using IME input #151

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vincentdchan
Copy link

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 batchStart and batchEnd in 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.

2024-10-15 21 13 21

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

Copy link

@Gowtham-Muthupandian Gowtham-Muthupandian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Approved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants