React-Virtualized returns incorrect scrollTop when new items are added

 ̄綄美尐妖づ 提交于 2019-12-24 19:41:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!