quill icon indicating copy to clipboard operation
quill copied to clipboard

Avoid emitting change events for void operations

Open luin opened this issue 1 year ago • 0 comments

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.

luin avatar May 10 '24 04:05 luin