quill icon indicating copy to clipboard operation
quill copied to clipboard

Calling quill.format() moves the cursor.

Open Philostastically opened this issue 2 years ago • 0 comments

Steps for Reproduction

  1. 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");
  }
}); 
  1. 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

Philostastically avatar Sep 14 '22 20:09 Philostastically