bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data
http://bvaughn.github.io/react-virtualized/
MIT License
26.1k stars 3.05k forks source link

Grid rows disappear when sibling elements are conditionally rendered in #1812

Closed resthedev closed 1 year ago

resthedev commented 1 year ago

Bug Report

What is the current behavior?

I am using a combination of:

Whenever a sibling element of my Grid is conditionally rendered in, it seems to cause issues with rows disappearing when scrolling down. Maybe this is an issue with WindowScroller when something else exits and enters the DOM?

Code Sandbox Repro

To reproduce:

  1. Try scrolling with the Box hidden. It should be fine.
  2. Click the Show/Hide Box button.
  3. Try scrolling (now with the Box shown). You should see the rows of the grid disappearing like this.

What is the expected behavior?

Grid should be unaffected/adjust to other sibling elements conditionally entering the DOM.

Which versions of React and react-virtualized, and which browser / OS are affected by this issue? Did this work in previous versions of react-virtualized?

Browser Arc
OS Mac OS Ventura 13.2.1
React 18.2.0
React DOM 18.2.0
react-virtualized 9.22.3

Not sure if this occurred in previous versions or not. Thank you for your help!

resthedev commented 1 year ago

Whoops, looks like I just saw this part of the docs that I missed:

CleanShot 2023-03-22 at 13 20 14@2x

Will try this and see if it fixes my issue.