developerdizzle / react-virtual-list

Super simple virtualized list React component
http://developerdizzle.github.io/react-virtual-list/
MIT License
619 stars 73 forks source link

[Bug/Feature Request] Resize Event Listener not appropriate when container option not window #51

Open haxxxton opened 7 years ago

haxxxton commented 7 years ago

Currently VirtualList attaches to the 'resize' event on the supplied container option.

This is fine when window is supplied as the container, but will not fire when an alternate element is supplied.

There are a number of approaches for detecting element size change of non-window elements that could be integrated to correctly trigger this.refreshState.

Happy to submit a PR if you wanted to choose which lib you liked best.

developerdizzle commented 6 years ago

Personally, I think the ResizeObserver pattern with a note about requiring a polyfill would be best.