Skip to content

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

@oleksandr-danylchenko

Description

@oleksandr-danylchenko

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

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