Skip to content

fix: grid not rendering on scroll drag#4750

Open
lukecotter wants to merge 3 commits into
tabulator-tables:masterfrom
lukecotter:fix-grid-not-rendering-on-scroll-drag
Open

fix: grid not rendering on scroll drag#4750
lukecotter wants to merge 3 commits into
tabulator-tables:masterfrom
lukecotter:fix-grid-not-rendering-on-scroll-drag

Conversation

@lukecotter

@lukecotter lukecotter commented May 8, 2025

Copy link
Copy Markdown
Contributor

fix: ensure height is not undefined

With a variableHeight: true on a column and a fixed height grid, if I dragged the scroll halfway down all rows would vanish.

Setting dataTree: true is a workaround for the issue.

This is because rowsToRender would end up being NaN after initial render due
to row.getHeight() being undefined and the sum for rowsHeight resulting in NaN, which caused avgRowHeight to also be NaN.

With rowsToRender and avgRowHeight nothing rendered.

Sometimes heightInitialized would be true because setCellHeight had be called.
The row outerHeight was undefined still, we now check offsetHeight and vDomRowHeight as fallback.

lukecotter added 2 commits May 8, 2025 18:30
With dataTree:false and a fixed height grid, if I dragged the scroll halfway down
all rows would vanish.

This is because `rowsToRender` would end up being NaN after initial render due
to `row.getHeight()` being undefined and the sum for `rowsHeight` resulting in NaN, which caused `avgRowHeight` to also be NaN.

With `rowsToRender` and `avgRowHeight` nothing rendered.

Sometimes heightInitialized would be true because setCellHeight had be called.
The row outerHeight is 0 still, we now check offsetHeight and vDomRowHeight as fallback.
@azmy60

azmy60 commented Jun 23, 2025

Copy link
Copy Markdown
Collaborator

Hey @lukecotter ! Could you give us a little example of the code? This is my code but I can't replicate the issue you mentioned.

@lukecotter

lukecotter commented Jun 29, 2025

Copy link
Copy Markdown
Contributor Author

@azmy60
Sorry slightly got the cause wrong.
Set variableHeight:true on a column to show the issue.
Setting dataTree: true is a workaround for the issue.

Here is a fiddle

…ing-on-scroll-drag

# Conflicts:
#	src/js/core/rendering/renderers/VirtualDomVertical.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants