The mouse selection dispatches the selectstart event only once and after that, only the selectionchange until you release. During that time you're stuck in "at least 1-char selection limbo", and the rendered highlight won't get dismissed
The keyboard selection dispatches the distinct selectstart event each time the previous selection range becomes collapsed. So each time you switch the selection direction, a new leftover annotation gets saved. Which is even more annoying than the mouse-limbo 💀
Suggested Changes
We should track the moment when the previously populated selection range collapses. That should signify the selection cancellation. Then, such leftover annotations can be deleted.
Issue
Once you start selecting the text either by mouse or keyboard, you cannot cancel it by collapsing the selection range.
Mouse
https://github.com/user-attachments/assets/8ee72e2d-eadc-4bcb-9668-620713355ac7
The mouse selection dispatches the
selectstart
event only once and after that, only theselectionchange
until you release. During that time you're stuck in "at least 1-char selection limbo", and the rendered highlight won't get dismissedKeyboard
https://github.com/user-attachments/assets/71286df9-e1cb-4fb1-b139-6ff14c7b885b
The keyboard selection dispatches the distinct
selectstart
event each time the previous selection range becomes collapsed. So each time you switch the selection direction, a new leftover annotation gets saved. Which is even more annoying than the mouse-limbo 💀Suggested Changes
We should track the moment when the previously populated selection range collapses. That should signify the selection cancellation. Then, such leftover annotations can be deleted.