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

Dismissing the selection on Android takes 2 taps #159

Open
oleksandr-danylchenko opened this issue Oct 15, 2024 · 0 comments
Open

Dismissing the selection on Android takes 2 taps #159

oleksandr-danylchenko opened this issue Oct 15, 2024 · 0 comments

Comments

@oleksandr-danylchenko
Copy link
Contributor

oleksandr-danylchenko commented Oct 15, 2024

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: ✅

oleksandr-danylchenko added a commit to oleksandr-danylchenko/text-annotator-js that referenced this issue Oct 15, 2024
# Conflicts:
#	packages/text-annotator-react/src/TextAnnotatorPopup/TextAnnotatorPopup.tsx
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

No branches or pull requests

1 participant