quill
quill copied to clipboard
Calling quill.format() moves the cursor.
Steps for Reproduction
- Enter the following code in https://quilljs.com/playground/
modules: {
toolbar: [
[{ header: [1, 2, false] }],
['bold', 'italic', 'underline'],
['image', 'code-block']
]
},
placeholder: 'Compose an epic...',
theme: 'snow' // or 'bubble'
});
quill.on("selection-change", (range, oldRange, source) => {
if (range) {
if (range.length == 0) {
quill.format("color", "blue");
}
} else {
console.log("Cursor not in the editor");
}
});
- Move the cursor with the arrow keys. Or select different different cursor positions.
Expected behavior: The cursor should move normally through the text
Actual behavior: The cursor will jump around as quill.format() will occasionally move the cursor.
Platforms: Chrome v105.0.5195.102
Version: v1.3.7