Skip to content

fix: grid not rendering on scroll drag #4750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lukecotter
Copy link
Contributor

@lukecotter lukecotter commented May 8, 2025

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
Copy link
Collaborator

azmy60 commented Jun 23, 2025

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
Copy link
Contributor Author

lukecotter commented Jun 29, 2025

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants