Skip to content

Commit

Permalink
Merge pull request #1992 from malloydata/dashboard-table-virtual-scroll
Browse files Browse the repository at this point in the history
fix: table virtual scroll bug with missing items
  • Loading branch information
skokenes authored Nov 1, 2024
2 parents 24fbae1 + abe204c commit 8485b6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function DashboardItem(props: {
resultMetadata: props.resultMetadata,
customProps: {
table: {
disableVirtualization: props.maxTableHeight,
disableVirtualization: !props.maxTableHeight,
},
},
});
Expand Down
4 changes: 3 additions & 1 deletion packages/malloy-render/src/component/table/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,9 @@ const MalloyTableRoot = (_props: {
if (props.scrollEl) scrollEl = props.scrollEl;
let virtualizer: Virtualizer<HTMLElement, Element> | undefined;

const [rowEstimate, setRowEstimate] = createSignal(28);
// Set arbitrarily large initial height to deal with weird measurement bug https://github.com/TanStack/virtual/issues/869
// Could possibly try to pre-calculate a height estimate using metadata, but may be hard to do with potentially wrapping text so would have to add a buffer
const [rowEstimate, setRowEstimate] = createSignal(1000);

const shouldVirtualize = tableCtx.root && !props.disableVirtualization;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ source: products is duckdb.table("data/products.parquet") extend {
order_by: dcId
}

# dashboard { table.max_heightX=100000 }
# dashboard { table.max_height=100000 }
view: seriesCharts is {
group_by: ` ` is 'Line Charts'
# line_chart
Expand Down

0 comments on commit 8485b6f

Please sign in to comment.