Don't show minimap when view is not scrollable (#10062)

This commit is contained in:
Nicolas Mowen 2024-02-26 11:31:21 -07:00 committed by GitHub
parent 76ad91f9b5
commit 1dd904d89a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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>();
@ -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}