petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.25k stars 301 forks source link

[BUG] When trying to render list with Material UI Table it only render half of the list after upgrading to v2.4.0 it worked fine with v2.3.1 #533

Closed calvin44 closed 2 years ago

calvin44 commented 2 years ago

Describe the bug The list is rendered only half, the other half is empty

Reproduction https://codesandbox.io/s/react-virtuoso-test-huvxl?file=/src/App.js

To Reproduce Steps to reproduce the behavior: click add item button to add more items to the list the full list is not rendered

Expected behavior It should be rendered normally till the end

Screenshots image

Additional context It worked fine in v2.3.1

jhg023 commented 2 years ago

I'm experiencing this issue and was forced to downgrade to v2.3.1 as well.

petyosi commented 2 years ago

Hey,

The setup has worked accidentally so far. It's not something that the library is designed to support at the moment. In fact, React itself gives you a very descriptive error about invalid markup. Cleaning up the tables yields a working example.

I'm going to close this issue. If you feel like supporting tables is something you want to contribute towards or sponsor, contact me.

calvin44 commented 2 years ago

thank you for your answer, but can I know the reason why it worked fine in v2.3.1?

petyosi commented 2 years ago

It worked because of an insufficient scrollTop tracking logic that did not take into account list resizing.

petyosi commented 2 years ago

@calvin44 @jhg023 2.5.0 includes a proper table support - https://virtuoso.dev/hello-table/