quill
quill copied to clipboard
Avoid emitting change events for void operations
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.