Skip to content

Commit 3701645

Browse files
committed
fix: use visibility:hidden instead of display:none for chart stack
display:none collapses layout height to 0, still causing scroll reset. visibility:hidden preserves the element's box model and height.
1 parent 020d484 commit 3701645

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/components/ReportPageLayout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,9 @@ export function ReportPageLayout({ schema, allowedReportTypes, metricOptions }:
586586
|| activeReport?.type === REPORT_TYPES.ENTERPRISE_MEMBERS;
587587
return (
588588
<Suspense fallback={null}>
589-
{/* Keep chart DOM alive during transient empty states (e.g. startTransition
590-
filter updates) to prevent body-height collapse → scroll-position loss. */}
591-
<div className={styles.chartStack} key={activeReportIndex} style={hasData ? undefined : { display: 'none' }}>
589+
{/* Use visibility:hidden (not display:none) during transient empty states
590+
so the chart DOM keeps its layout height and scroll position is preserved. */}
591+
<div className={styles.chartStack} key={activeReportIndex} style={hasData ? undefined : { visibility: 'hidden' }}>
592592
{!isFlatReport && (
593593
<div className={styles.chartSurface}>
594594
<TimeSeriesChart metricOptions={chartMetricOptions} />

0 commit comments

Comments
 (0)