-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
Issue
When you have a selection within the annotatable container and click outside - the selected annotation won't be dismissed.
Instead, the userSelect method is called on it:
Screen.Recording.2024-08-13.at.16.21.06.mov
That's because the pointerDown method is initialized only on the container, but the pointerUp is initialized on the whole document. Therefore, the currentTarget is still present when the latter is executed, and the evt.timeStamp - lastPointerDown.timeStamp is always too large:
text-annotator-js/packages/text-annotator/src/SelectionHandler.ts
Lines 151 to 157 in e6d3f33
| // Just a click, not a selection | |
| if (document.getSelection().isCollapsed && timeDifference < 300) { | |
| currentTarget = undefined; | |
| clickSelect(); | |
| } else if (currentTarget) { | |
| selection.userSelect(currentTarget.annotation, evt); | |
| } |
Metadata
Metadata
Assignees
Labels
No labels