问题
I am trying to create my own version of infinite scroll. In this version of infinite scroll, I am using react-virtualized
to get good performance.
You can access the codesandbox here: https://codesandbox.io/embed/github/Vishal1419/infinite-scroll/tree/master/
When I scroll at the bottom, the new records are added to the list, that's what a typical infinite-scroll do. But when new records are added, scrollTop increases by 16px
everytime. I don't know the reason behind that.
I have already tried to sort out the issue and tried to fix it from last 3-4 hours effort. But I don't know why WindowScroller is returning me +16px there. If anyone having experience with using react-virtualized take a look at my code, then I think he may be able to explain me the cause of the issue.
The implementation of react-virtualized is in this file: src/shared/InfiniteScroll/components/Items/VirtualizedItems.jsx
Thank you.
来源:https://stackoverflow.com/questions/58446144/react-virtualized-returns-incorrect-scrolltop-when-new-items-are-added