fast scrolling in InfiniteLoader scrolls back to top after data is loaded
I am using an InfiniteLoader with a Table and the problem I'm having is the following: when I move the scrollbar to the end quickly (or an index where data is not yet loaded), it scrolls back to the top after data is loaded. This problem can also be observed in the demo example here
+1
Ooh, nice bug report.
Looks like it's not specific to Table (which makes sense considering Table and List both use Grid internally). Adding some logging, I see that Grid is getting a "scroll" event with scrollTop:0 for some reason.
Edit 1: Looks like _updateScrollTopForScrollToRow is setting state.scrollTop to 0 for some reason, which causes componentDidUpdate to then scroll the DOM node back to 0 as well.
This looks like something introduced by me recently when I added support for the new async CellMeasurer to Grid. (Sorry!) recomputeGridSize is called by InfiniteLoader once its new rows load. This in turn sets the _recomputeScrollTopFlag flag which causes the chain of methods I mentioned above to be invoked.
This shouldn't matter, since _updateScrollTopForScrollToRow short-circuits if the user hasn't actually specified a scrollToRow- or at least it attempts to 😅 but in this case scrollToRow is null (because of an old, unused state prop in my example) and null >= 0 is true 🤡.
I have to run to an appointment now but the fix for this is simple. I just want to make sure I added at least one regression test first. I'll get it done sometime this morning/afternoon.
Fixed in 2176a5f. Will go out in 9.1.0 shortly.
Super! Will test it when it's out
It was released with 9.1.0 yesterday.
It seems that this is still happening. Using WindowScroller, InfinitedLoader, Autosizer and List
may I know any workaround on it ?
@vn425282 @nicolasletoublon I am guessing you guys don't have a skeleton and are just rendering null in renderActionRow when there is nothing to render.