Skip to content

Conversation

@oleksandr-danylchenko
Copy link
Contributor

@oleksandr-danylchenko oleksandr-danylchenko commented Nov 11, 2024

Issue

See - #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:

  • selectionchange event is emitted but there's no currentTarget present (already in place)
  • On "Select All" handling
  • On an arbitrary arrow press
  • Click beyond the annotation range

@rsimon
Copy link
Member

rsimon commented Nov 21, 2024

Thanks!

@rsimon rsimon merged commit d82e9f9 into recogito:main Nov 21, 2024
@oleksandr-danylchenko oleksandr-danylchenko deleted the #179-fix-losing-same-annotation-reference branch November 21, 2024 12:03
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

Successfully merging this pull request may close these issues.

2 participants