Is there anyway one get get/set the cursor in Quill? I'm not talking about the multi cursor module, but just the default cursor with a single edit. I want to let users save the document and the position of the cursor. If the document is loaded at a later stage, the cursor position should also be loaded and Quill should move it to the previously saved location.
Quill.getSelection() and Quill.setSelection()
Thanks, that's sort of what I was looking for. Is there any way to translate the cursor selection to pixel offset? Hence, if the cursor is at position 50, how many pixels from the top (and left) of the editor content is it.
Or otherwise, determine in which div the cursor is (the divs that are added for a newline). Once you know in which newline-div the cursor is, one can simply multiply it by the height of the div (and subtract some padding).
You can use getBounds(50). It's not finalized yet so for now you must pass in an integer index. If you want to do it for the current location of the cursor you'll have to use it in combination with getSelection()
Most helpful comment
Quill.getSelection()andQuill.setSelection()