File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -93,13 +93,18 @@ export const TextAnnotationPopup = (props: TextAnnotationPopupProps) => {
93
93
const { getFloatingProps } = useInteractions ( [ dismiss , role ] ) ;
94
94
95
95
useEffect ( ( ) => {
96
- if ( annotation ?. id ) {
96
+ if ( ! r ) return ;
97
+
98
+ const annotationId = annotation ?. id ;
99
+ const annotationSelectorsLength = annotation ?. target . selector . length ;
100
+
101
+ if ( annotationId && annotationSelectorsLength > 0 ) {
97
102
const bounds = r ?. state . store . getAnnotationBounds ( annotation . id ) ;
98
103
setOpen ( Boolean ( bounds ) ) ;
99
104
} else {
100
105
setOpen ( false ) ;
101
106
}
102
- } , [ annotation ?. id , r ?. state . store ] ) ;
107
+ } , [ annotation ?. id , annotation ?. target . selector , r ?. state . store ] ) ;
103
108
104
109
useEffect ( ( ) => {
105
110
if ( ! r ) return ;
You can’t perform that action at this time.
0 commit comments