reedsy / quill-cursors

A multi cursor module for Quill text editor.
MIT License
248 stars 54 forks source link

caret off by one? #13

Closed jeffbryner closed 5 years ago

jeffbryner commented 5 years ago

When applying a cursor range using setCursor, the caret positions seem to be off by one?

Selections seem to be accurate, but especially when the caret is at position 0 the caret renders just after the first character. Here's a screen shot of a meteor quill object that's syncing deltas and now cursors with your nifty module.

The private window in the foreground is positioned at 0, you can see in the console the range is set to 0, however it's rendered just after the first char:

screen shot 2018-10-07 at 3 11 10 pm
jeffbryner commented 5 years ago

Fixed this up by changing the css:

  .ql-cursor .ql-cursor-caret-container {
    margin-left: -18px;