You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR improves BaseTable performance and stability for large virtualized tables, especially during fast bidirectional scrolling and drag-and-drop reordering.
What changed
Added opt-in adaptive row virtualization through adaptiveFlushSync.
Added direct DOM updates for row positions and table body size to avoid unnecessary React renders during scrolling.
Added bounded, velocity-aware row preloading and deferred row placeholders to prevent visible gaps.
Preserved stable row DOM nodes during immutable reordering and tree reparenting.
Added optional deferred rendering for horizontally offscreen passive cell content via BaseTable.canDeferOffscreenCellContent.
Memoized table rows and cells while keeping table-dependent content up to date.
Improved row and column drag auto-scroll coordination and cleanup.
Improved useColumnsAutoSize by cancelling stale measurements, serializing React element measurements, and cleaning up measurement roots correctly.
Refactored virtualization logic into dedicated hooks and utilities under useAdaptiveVirtualizer.
Updated @tanstack/react-virtual from 3.11.2 to 3.14.10.
Added documentation and Storybook examples for adaptive virtualization and virtualized tree reordering.
Usage notes
Adaptive virtualization is opt-in. Existing virtualization behavior remains unchanged unless the new options are enabled.
Stable semantic getRowId and getItemKey values are required when rows can be reordered or reparented.
A custom rangeExtractor remains authoritative and disables adaptive range planning.
canDeferOffscreenCellContent should only be enabled for passive content that cannot affect geometry, focus, accessibility, or application state.
@beliarh I've added an idle geometry reconciliation pass for virtualized rows src/components/BaseTable/utils/remeasureRenderedRows.ts. TanStack Virtual does not synchronously measure rows mounted during scrolling, and a later measureElement call may return the cached size instead of reading the DOM. If the corresponding ResizeObserver notification is delayed or missed, stale heights remain in the cache, causing gaps or overlapping rows until a window resize triggers a new measurement.
The reconciliation runs only after scrolling stops and only when direct DOM updates are enabled. It validates the row key, index, DOM ownership, and realization state, batches all layout reads, and calls resizeItem only for rows whose actual size differs from the cached value. This keeps layout reads out of the active scroll path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves
BaseTableperformance and stability for large virtualized tables, especially during fast bidirectional scrolling and drag-and-drop reordering.What changed
adaptiveFlushSync.BaseTable.canDeferOffscreenCellContent.useColumnsAutoSizeby cancelling stale measurements, serializing React element measurements, and cleaning up measurement roots correctly.useAdaptiveVirtualizer.@tanstack/react-virtualfrom3.11.2to3.14.10.Usage notes
Adaptive virtualization is opt-in. Existing virtualization behavior remains unchanged unless the new options are enabled.
Stable semantic
getRowIdandgetItemKeyvalues are required when rows can be reordered or reparented.A custom
rangeExtractorremains authoritative and disables adaptive range planning.canDeferOffscreenCellContentshould only be enabled for passive content that cannot affect geometry, focus, accessibility, or application state.