react-infinite-scroll-component
react-infinite-scroll-component copied to clipboard
Inverse scroller - loader is not visible on top
When scrolling up (Inverse) to the top, I expect to see the loader component on top of the page until new data is loaded. Instead, the scroller is adding the loader component as a new item at the top, but the scroller stays at the same position so the user needs to scroll up a touch to see the loader component. Any ideas how to fix it? Code (based on duke7able example): https://codesandbox.io/s/youthful-kapitsa-nlv1j (increase setTimeout)

Manage to work around this issue although I'm sure there are better ways to do it:
- Make a ref object and assign it to the scroller container div.
- pass the ref object to the loader component.
- useEffect/component is mounted and set the scrollTop to the scrollHeight * -1:
scrollerContainer.current.scrollTop = scrollerContainer.current.scrollHeight * -1
I'm leaving this issue open incase there are better solutions