question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] List height does not update when items size changes *without* transitions

See original GitHub issue

Describe 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 image

Desktop (please complete the following information):

  • Tested in Mac OSX
  • Tested in Chrome

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
petyosicommented, Mar 26, 2021

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.

1reaction
chamerlingcommented, Apr 30, 2021

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 🍺

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found