Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/ui/components/AttachmentsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,14 @@ export const AttachmentsButton: React.FC<AttachmentsButtonProps> = ({
{/* Backdrop */}
<div
className="fixed inset-0 z-[90]"
data-popover-layer
onClick={() => setIsOpen(false)}
/>

{/* Popover content */}
<div
className="fixed z-[100] w-72 bg-card border border-border rounded-xl shadow-2xl p-3"
data-popover-layer
style={{ top: position.top, left: position.left }}
onClick={e => e.stopPropagation()}
>
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/components/CommentPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ export const CommentPopover: React.FC<CommentPopoverProps> = ({
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();
};

Expand Down
1 change: 1 addition & 0 deletions packages/ui/components/ImageAnnotator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export const ImageAnnotator: React.FC<ImageAnnotatorProps> = ({
return (
<div
className="fixed inset-0 z-[200] flex items-center justify-center bg-background/90 backdrop-blur-sm"
data-popover-layer
onClick={handleBackdropClick}
>
{/* Canvas with image and toolbar */}
Expand Down