Skip to content

Dismissing the selection on Android takes 2 taps #159

@oleksandr-danylchenko

Description

@oleksandr-danylchenko

Issue

Certain reasons filter the annotation selection dismissal:

onOpenChange: (open, _event, reason) => {
if (!open && (reason === 'escape-key' || reason === 'focus-out')) {
setOpen(open);
r?.cancelSelected();
}
},

So when a user on Android presses outside of the popup area - the selection doesn't get dismissed. Instead, they need to press twice. The first time the focus is placed outside of the popup, and the second time the tap is recognized as a "click" over a not-selectable area by the SelectionHandler.

Record_2024-10-15-13-19-32.mp4

Suggested Changes

Remove the reason filtering and always dismiss the annotation selection when the popup is about to be closed. As the closure reason usually will be the outside-press, focus-out, and escape-key.


The issue turned out to be related to the isCollapse still being false even though a user tapped outside of the active selection...
See - #136 (comment) & #163


Another issue is that the pointerup/pointerdown events handling was gated by the isContextMenu flag. See - #167
UPD: ✅

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