Skip to content

Commit f786661

Browse files
committed
Removed pointerup/keydown event requirement from popup
1 parent 47066df commit f786661

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/text-annotator-react/src/TextAnnotatorPopup/TextAnnotatorPopup.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ export const TextAnnotatorPopup = (props: TextAnnotationPopupProps) => {
7373
const { getFloatingProps } = useInteractions([dismiss, role]);
7474

7575
const selectedKey = selected.map(a => a.annotation.id).join('-');
76+
7677
useEffect(() => {
7778
// Ignore all selection changes except those accompanied by a user event.
78-
if (selected.length > 0 && event) {
79-
setOpen(event.type === 'pointerup' || event.type === 'keydown');
79+
if (selected.length > 0) { // && event) {
80+
setOpen(true); // event.type === 'pointerup' || event.type === 'keydown');
8081
}
81-
}, [selectedKey, event]);
82+
}, [selectedKey /*, event */]);
8283

8384
useEffect(() => {
8485
// Close the popup if the selection is cleared

0 commit comments

Comments
 (0)