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

Avoid emitting change events for void operations #4195

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

Conversation

luin
Copy link
Member

@luin luin commented May 10, 2024

Closes #4190

The cause is that when deleteText() doesn't do anything (either length is 0 or index is after the end), change passed to Editor#update() would be a delta that contains a void retain (e.g. new Delta().retain(10)), which causes editor-change/text-change to be emitted with that delta.

This PR fixed the issue by always calling chop() when the provided change will be used.

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