-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
Issue
Currently, the TextAnnotatorPopup component appears only on the pointerup event:
text-annotator-js/packages/text-annotator-react/src/TextAnnotatorPopup.tsx
Lines 46 to 52 in 36958ad
| 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
Labels
No labels