recogito / text-annotator-js

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

#179 Removed excessive selection cleanup #180

Closed oleksandr-danylchenko closed 6 days ago

oleksandr-danylchenko commented 2 weeks ago

Issue

See - https://github.com/recogito/text-annotator-js/issues/179

Changes Made

I removed the excessive selection.clean() calls that can cause losing the same selected annotation reference. Previously upon releasing the Shift or a finger, the selection was cleared out and immediately updated. That cleanup would make the consumer think that a brand-new annotation was selected while the user just kept selecting the text after a pause. Additionally, that cleanup is processed inconsistency in React 18 vs React <18 consumers.

Now, the selection is cleared only on:

rsimon commented 6 days ago

Thanks!