Range Index bug at the first character/blot of each line
Miloage opened this issue · comments
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](https://private-user-images.githubusercontent.com/20221782/349762195-2d91c810-bf52-431a-a236-1c9096d1e23f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMTI5NTAsIm5iZiI6MTcyMjExMjY1MCwicGF0aCI6Ii8yMDIyMTc4Mi8zNDk3NjIxOTUtMmQ5MWM4MTAtYmY1Mi00MzFhLWEyMzYtMWM5MDk2ZDFlMjNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI3VDIwMzczMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNjN2QzNWRlNWQzNDRhNDE2MDUzMGI0MWEyZDJhMzZhYmU1ZjU2NDVhMDQ1ODVjOWM4ZjQ3MzQ3YmIyMDc5N2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Z_X74v-jb0SY28o2NRgnjYvYENN2JghalugrikA94jw)
explain. If you want to listen to selection-change
. You need to use editor-change
event
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.