recogito / text-annotator-js

A JavaScript library for text annotation.
BSD 3-Clause "New" or "Revised" License
21 stars 7 forks source link

Releasing `Shift` or "handlebar" over the same selection leads to redundant `updateTarget` calls #169

Closed oleksandr-danylchenko closed 2 weeks ago

oleksandr-danylchenko commented 3 weeks ago

Issue

In the new SelectionHandler such events as "releasing the Shift" or "releasing the handlebar" are considered as "selection finishing events". In both cases, the upsertCurrentTarget gets called almost immediately. However, a user can simply press Shift or tap over the handlebar, which will also lead to redundant updateTarget calls upon the initial creation.

Demo

Desktop

https://github.com/user-attachments/assets/d8362214-20c1-4e79-b4a1-6994bfc7aa63

Mobile

https://github.com/user-attachments/assets/cc2614c4-c239-4d27-8f90-0682b503733f

image