-
Notifications
You must be signed in to change notification settings - Fork 7
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
#133 Fixed missing annotation dismissal clicking outside of the annotator container
#135
#133 Fixed missing annotation dismissal clicking outside of the annotator container
#135
Conversation
evt.target instanceof Node && | ||
container.contains(evt.target) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the container.contains
as a small optimization that will immediately dismiss clicks outside of the container
. So we won't need to execute the relatively heavier getAt
method
Thanks - another nice & useful one! |
I had to revert this change for now, unfortunately. We have a 'Delete' button for the current annotation (outside the annotatable area). It is only shown when the annotation is selected. Because the selection got discarded before the click event, clicking the button had no effect. (The button was unmounted before the click event.) It looks like I can get around this by using the |
Right... Until the |
Unfortunately, moving the Screen.Recording.2024-09-03.at.20.08.28.movThat happens because starting the selection within the interactive element - traps the selection range within it. Therefore, on the |
However, I think I have an idea of how to:
It's capturing the
Does it sound right to you, @rsimon? |
Issue - #133
Changes Made
To capture the actual
lastPointerDown
event on the page and make the correcttimeDifference
calculations, I addedpointerdown
event to thedocument
scope.In that way, the "click" will be properly recognized in the
pointerup
handler and the selection will be dismissed. As there will be no annotation under the pointer.