When clicking on the button, it adjusts columnCount from 2 to 1 and triggers the error.
The bug exists when columns use variable widths for columns:
columnWidth={({ index }) => widths[index]}
but not when using fixed widths:
columnWidth={({ index }) => 100}
What is the expected behavior?
There should be no error and this should be a valid state transition
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?
This bug only seems to occur when you return a columnWidth that is not a multiple of 100 (try returning 45 hardcoded) and when the columnCount becomes equal to the fixedColumnCount after being larger.
Asking a Question?
Please don't file GitHub issues to ask questions! Instead use:
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Sandbox: Code Sandbox Click the button to see the bug:
Requested index 0 is outside of range 0..0
start state is:
When clicking on the button, it adjusts
columnCount
from 2 to 1 and triggers the error.The bug exists when columns use variable widths for columns:
columnWidth={({ index }) => widths[index]}
but not when using fixed widths:
columnWidth={({ index }) => 100}
What is the expected behavior?
There should be no error and this should be a valid state transition
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?