Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(segmentation scroll): and hydration bugs #3701

Merged
merged 3 commits into from
Oct 6, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export default function PanelSegmentation({

return (
<>
<div className="flex min-h-0 flex-auto select-none flex-col justify-between">
<div className="ohif-scrollbar flex min-h-0 flex-auto select-none flex-col justify-between overflow-auto">
<SegmentationGroupTable
title={t('Segmentations')}
segmentations={segmentations}
Expand Down
4 changes: 4 additions & 0 deletions platform/ui/src/components/Notification/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ const Notification = ({ id, type, message, actions, onSubmit, onOutsideClick })
}
};

// Both a mouse down and up listeners are desired so as to avoid missing events
// from elements that have pointer-events:none (e.g. the active viewport).
document.addEventListener('mousedown', handleClick);
document.addEventListener('mouseup', handleClick);

return () => {
document.removeEventListener('mousedown', handleClick);
document.removeEventListener('mouseup', handleClick);
};
}, [onOutsideClick]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ function SegmentationDropDownRow({
storeSegmentation(activeSegmentation.id);
},
},
{
title: 'Download',
onClick: () => {
onSegmentationDownload(activeSegmentation.id);
},
},
]
: []),
...[
{
title: 'Download',
onClick: () => {
onSegmentationDownload(activeSegmentation.id);
},
},
],
]}
>
<div className="hover:bg-secondary-dark mx-1 grid h-[28px] w-[28px] cursor-pointer place-items-center rounded-[4px]">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,18 @@ const SegmentationGroupTable = ({
</div>
) : (
<div className="mt-1 select-none">
{!disableEditing && (
<SegmentationDropDownRow
segmentations={segmentations}
disableEditing={disableEditing}
activeSegmentation={activeSegmentation}
onActiveSegmentationChange={onActiveSegmentationChange}
onSegmentationDelete={onSegmentationDelete}
onSegmentationEdit={onSegmentationEdit}
onSegmentationDownload={onSegmentationDownload}
storeSegmentation={storeSegmentation}
onSegmentationAdd={onSegmentationAdd}
onToggleSegmentationVisibility={onToggleSegmentationVisibility}
/>
)}
<SegmentationDropDownRow
segmentations={segmentations}
disableEditing={disableEditing}
activeSegmentation={activeSegmentation}
onActiveSegmentationChange={onActiveSegmentationChange}
onSegmentationDelete={onSegmentationDelete}
onSegmentationEdit={onSegmentationEdit}
onSegmentationDownload={onSegmentationDownload}
storeSegmentation={storeSegmentation}
onSegmentationAdd={onSegmentationAdd}
onToggleSegmentationVisibility={onToggleSegmentationVisibility}
/>
{!disableEditing && showAddSegment && (
<AddSegmentRow onClick={() => onSegmentAdd(activeSegmentationId)} />
)}
Expand Down