Skip to content

Commit

Permalink
Don't show minimap when view is not scrollable (#10062)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Feb 26, 2024
1 parent 76ad91f commit 1dd904d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion web/src/views/events/DesktopEventView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ export default function DesktopEventView({
return current;
}, [reviewItems, severity]);

const showMinimap = useMemo(() => {
if (!contentRef.current) {
return false;
}

return contentRef.current.scrollHeight > contentRef.current.clientHeight
}, [contentRef.current?.scrollHeight])

// review interaction

const pagingObserver = useRef<IntersectionObserver | null>();
Expand Down Expand Up @@ -310,7 +318,7 @@ export default function DesktopEventView({
timestampSpread={15}
timelineStart={timeRange.before}
timelineEnd={timeRange.after}
showMinimap
showMinimap={showMinimap}
minimapStartTime={minimapBounds.start}
minimapEndTime={minimapBounds.end}
events={reviewItems.all}
Expand Down

0 comments on commit 1dd904d

Please sign in to comment.