Skip to content

Commit

Permalink
disable Table virtualizer based on prop (#2174)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 authored Jul 26, 2024
1 parent 29383b1 commit 15dc180
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-carpets-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@itwin/itwinui-react': patch
---

Fixed an issue in `Table` where the virtualizer was being initialized when the `enableVirtualization` prop wasn't set to `true`.
1 change: 1 addition & 0 deletions packages/itwinui-react/src/core/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ export const Table = <
});

const { virtualizer, css: virtualizerCss } = useVirtualScroll({
enabled: enableVirtualization,
count: page.length,
getScrollElement: () => tableRef.current,
estimateSize: () => rowHeight,
Expand Down

0 comments on commit 15dc180

Please sign in to comment.