[BUG] List height does not update when items size changes *without* transitions
See original GitHub issueDescribe the bug Similar to https://github.com/petyosi/react-virtuoso/issues/314, the list height does not update as expected even when not using transitions.
Reproduction https://codesandbox.io/s/aged-resonance-evq3r
Workaround
Adapted with rerender parent component approach see https://github.com/petyosi/react-virtuoso/issues/322#issuecomment-807428391
https://codesandbox.io/s/twilight-grass-12d1d
To Reproduce Steps to reproduce the behavior: Find Item e.g. 14, Click on expand and collapse again
Expected behavior The scrollbar should have disappeared when the list height has been updated accordingly.
Screenshots

Desktop (please complete the following information):
- Tested in Mac OSX
- Tested in Chrome
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
[BUG] The list height does not update when items size ...
Description When switching from scrollable list to non-scrollable list because of content change, the list height seems to not be re-calculated.
Read more >Max height transition is not working when the ... - Stack Overflow
I think the problem is that the sidebarSubcategories element has no defined height. It has a max-heigth of 0 and then it is...
Read more >Using CSS Transitions on Auto Dimensions
You try it out, and… the height doesn't transition. It snaps between the two sizes as if transition had never been set. After...
Read more >max-height - CSS: Cascading Style Sheets - MDN Web Docs
The max-height CSS property sets the maximum height of an element. It prevents the used value of the height property from becoming larger ......
Read more >Options - Splide
They'll seem to respond to dynamic change, but Splide does not guarantee the behavior. Here is the list of all options. Responsive options...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, it is a bug. I will look into it. A thing to notice though is that keeping state in the individual item is not a good idea. If you scroll beyond the current set of items, they will be unmounted, thus, their expanded state will be lost.
Great, this also fixes issue I was looking at when a sub component is lazy loading image with unknown height. Great job, thx for this 🍺