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

#169 Fixed repeated updates for the unchanged target #175

Merged

Conversation

oleksandr-danylchenko
Copy link
Contributor

Issue - #169

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.

The reason for such behavior was a missing check of whether the target that's about to be updated is different from the existing one.

Changes Made

I added the updated property comparison between the existing annotation target and the currentTarget. That effectively filters out repeated Shift key releases or taps over the handlebar, because there's no selectionchange event emitter that solely leads the updated prop change.

@rsimon
Copy link
Member

rsimon commented Nov 8, 2024

Thanks for this!!

@rsimon rsimon merged commit 22b45f0 into recogito:main Nov 8, 2024
@oleksandr-danylchenko oleksandr-danylchenko deleted the #169-fix-repeated-update-emission branch November 8, 2024 10:28
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