developerdizzle/react-virtual-list

Handle resizing

Closed this issue · 2 comments

Right now, getVirtualState is called in 4 places: getInitialState, componentWillReceiveProps, componentDidMount, and onScroll. If the window is resized, or the orientation changes on mobile, this causes the list to display too few or too many items, depending on the change.

A listener on the window for resize and orientation change events to call getVirtualState would fix this (I do this my own wrapper for VirtualList in my application). I can PR if you're interested!

Would love a PR for this!

Version 2 does this!