slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.62k stars 3.39k forks source link

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

Open Miloage opened 3 months ago

Miloage commented 3 months ago

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
zzxming commented 3 months ago

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

Miloage commented 3 months ago

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.