slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility

Home Page:https://quilljs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Range Index bug at the first character/blot of each line

Miloage opened this issue · comments

commented

After the input of the first character in each line, the range index did not change, failing to trigger the “selection-change” event.
If the first content is Embed blot, there is also such a problem.
As shown in Figure 2, after a line break input, there is only a “text-change” event and no “selection-change” event.
image

image

explain. If you want to listen to selection-change. You need to use editor-change event

commented

I don't necessarily need to listen to selection-change event, but when I input the first character, I get an incorrect range index.
getSelection() function sometimes cannot get the correct cursor position index, such as when entering the first character at the beginning of each line or when the cursor is focused immediately after the Blot element.