Fix stale cell heights after virtual row recycling - #4941
Open
tmichela wants to merge 1 commit into
Open
Conversation
Clear heightInitialized when row cells are discarded so virtual renderers normalize recreated cells after large scroll jumps and column refits. Add unit and browser regressions for the stale cell-height cache.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Invalidate a row’s cached height state whenever the row is deinitialized.
This fixes incorrectly sized cells after virtual rows are recycled, which can leave column borders and cell content such as status indicators only partially rendered.
Example, initial rendering:

After recycling:

Problem
With horizontal and vertical virtual rendering enabled, the issue can be reproduced by:
When the horizontal renderer discards a row’s cells,
Row.deinitialize()marks the row as uninitialized but leavesheightInitializedset totrue.When that row is rendered again, new cell elements are created. However, the stale height flag makes Tabulator treat their heights as already normalized, so the configured row height is not applied to the recreated cells. The cells can
consequently render at their natural content height, clipping or misaligning borders, pseudo-elements, and other height-dependent content.
Fix
Reset
heightInitializedinRow.deinitialize().This keeps the row lifecycle consistent: once the existing cell elements have been discarded, their cached height state is no longer valid. The next render therefore measures and normalizes the newly created cells.
Tests
Added:
Row.deinitialize()invalidates both initialization flags.