Skip to content

Annotation isn't dismissed clicking outside of the annotator container ⚠️ #133

@oleksandr-danylchenko

Description

@oleksandr-danylchenko

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:

// 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions