Skip to content

Commit

Permalink
Don't show phantom comment icon when highlight is invisible
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek committed Jun 27, 2024
1 parent 2670f66 commit c11c75a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dom/common/components/overlay/annotation-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ const HighlightOrUnderline: React.FC<HighlightOrUnderlineProps> = (props) => {
let commentIconRange = ranges[0].cloneRange();
collapseToOneCharacterAtStart(commentIconRange);
let rect = commentIconRange.getBoundingClientRect();
commentIconPosition = { x: rect.x + doc.defaultView!.scrollX, y: rect.y + doc.defaultView!.scrollY };
if (rect.x || rect.y || rect.width || rect.height) {
commentIconPosition = { x: rect.x + doc.defaultView!.scrollX, y: rect.y + doc.defaultView!.scrollY };
}
}
else {
commentIconPosition = null;
Expand Down

0 comments on commit c11c75a

Please sign in to comment.