Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The annotation selection cannot be discarded once at least a single character got selected ⚠️ #139

Closed
oleksandr-danylchenko opened this issue Aug 16, 2024 · 0 comments

Comments

@oleksandr-danylchenko
Copy link
Contributor

Issue

Once you start selecting the text either by mouse or keyboard, you cannot cancel it by collapsing the selection range.

Mouse

selection_loop.mp4

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

Keyboard

keyboard_selection_loop.mp4

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.

@oleksandr-danylchenko oleksandr-danylchenko changed the title The annotation selection cannot be canceled once at least a single character got selected ⚠️ The annotation selection cannot be discarded once at least a single character got selected ⚠️ Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant