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

Ctrl + A doesn't make the annotation popup to appear #111

Closed
oleksandr-danylchenko opened this issue Jun 30, 2024 · 1 comment
Closed

Ctrl + A doesn't make the annotation popup to appear #111

oleksandr-danylchenko opened this issue Jun 30, 2024 · 1 comment

Comments

@oleksandr-danylchenko
Copy link
Contributor

oleksandr-danylchenko commented Jun 30, 2024

Issue

Currently, the TextAnnotatorPopup component appears only on the pointerup event:

useEffect(() => {
// Ignore all selection changes except those
// accompanied by a pointer event.
if (pointerEvent) {
if (selected.length > 0 && pointerEvent.type === 'pointerup') {
setIsOpen(true);
} else {

But it ignores the keyboard selection that can be triggered by the Ctrl + A shortcut or a11y tools.

I suppose it's a shortcoming of the missing "selection completed" state in the store. Otherwise, we could make the SelectionHandler populate it upon meeting some predefined criteria. They can either be pointerup (sighted mouse users) or keyup (shortcuts and a11y tools support) event

Demo

Screen.Recording.2024-06-30.at.19.53.11.mov

The popup renders only upon clicking somewhere on the page, initiating the pointerup event

@rsimon
Copy link
Member

rsimon commented Oct 2, 2024

Addressed in PR #151

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

2 participants