Closed oleksandr-danylchenko closed 1 month ago
Discovered a bug that falsely deletes annotations in Firefox and Safari, but not Chrome:
https://github.com/user-attachments/assets/1171ce99-e8a7-4cb4-8994-b5fe526e0932
https://github.com/user-attachments/assets/6cb05779-2c28-4d90-ae7d-ad1379045d4e
The difference is that Chrome, when you click a mouse - immediately dispatches the selectstart
event, creating the new currentTarget
:
However, in FF & Safari, the start isn't dispatched, therefore, it thinks that the selection range collapsed for the previous annotation... 💀
Issue - https://github.com/recogito/text-annotator-js/issues/139
Changes Made
I added explicit deletion of the annotation that was created during the selection that collapsed. It removes zombie 1-char annotation when you switch the selection direction.