Skip to content

Commit

Permalink
Merge branch 'recogito#185-restore-android-popup' into staging-merge-…
Browse files Browse the repository at this point in the history
…candidate

# Conflicts:
#	packages/text-annotator-react/src/TextAnnotationPopup/TextAnnotationPopup.tsx
  • Loading branch information
oleksandr-danylchenko committed Dec 16, 2024
2 parents 83bb739 + fbae5c7 commit ffa9d37
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,18 @@ export const TextAnnotationPopup = (props: TextAnnotationPopupProps) => {
const { getFloatingProps } = useInteractions([dismiss, role]);

useEffect(() => {
if (annotation?.id && isAnnotationQuoteIdling) {
const bounds = r?.state.store.getAnnotationBounds(annotation.id);
if (!r) return;

const annotationId = annotation?.id;
const annotationSelectorsLength = annotation?.target.selector.length;

if (annotationId && annotationSelectorsLength > 0 && isAnnotationQuoteIdling) {
const bounds = r.state.store.getAnnotationBounds(annotation.id);
setOpen(Boolean(bounds));
} else {
setOpen(false);
}
}, [annotation?.id, isAnnotationQuoteIdling, r?.state.store]);
}, [annotation?.id, annotation?.target.selector, isAnnotationQuoteIdling, r?.state.store]);

useEffect(() => {
if (!r) return;
Expand Down

0 comments on commit ffa9d37

Please sign in to comment.