diff --git a/packages/ui/components/AttachmentsButton.tsx b/packages/ui/components/AttachmentsButton.tsx index fb31fd0..005cbbd 100644 --- a/packages/ui/components/AttachmentsButton.tsx +++ b/packages/ui/components/AttachmentsButton.tsx @@ -242,12 +242,14 @@ export const AttachmentsButton: React.FC = ({ {/* Backdrop */}
setIsOpen(false)} /> {/* Popover content */}
e.stopPropagation()} > diff --git a/packages/ui/components/CommentPopover.tsx b/packages/ui/components/CommentPopover.tsx index aa861cf..65df9f1 100644 --- a/packages/ui/components/CommentPopover.tsx +++ b/packages/ui/components/CommentPopover.tsx @@ -87,9 +87,9 @@ export const CommentPopover: React.FC = ({ const target = e.target as Node | null; if (!target) return; if (popoverRef.current?.contains(target)) return; - // Don't close if clicking inside an AttachmentsButton portal (z-index 90+) + // Don't close if clicking inside a child portal (AttachmentsButton, ImageAnnotator, etc.) const el = target as HTMLElement; - if (el.closest?.('[class*="z-[90]"], [class*="z-[100]"]')) return; + if (el.closest?.('[data-popover-layer]')) return; onClose(); }; diff --git a/packages/ui/components/ImageAnnotator/index.tsx b/packages/ui/components/ImageAnnotator/index.tsx index 9e3de44..9486e02 100644 --- a/packages/ui/components/ImageAnnotator/index.tsx +++ b/packages/ui/components/ImageAnnotator/index.tsx @@ -201,6 +201,7 @@ export const ImageAnnotator: React.FC = ({ return (
{/* Canvas with image and toolbar */}