How to maintain scroll position on data change? #327
Unanswered
MarkoIvanetic
asked this question in
Q&A
Replies: 1 comment
-
Releated issue: #346 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm implementing a chat using RV and trying to find a way to opt out of scroll effect caused by adding of the new item. Since the container is reversed, using css scale property, the messages are practically added to the top.
Inspecting rangeExtractor, I noticed that the indexes are not changing when adding new item. What happens is that array of rendered items changes and indexes are now referencing next set of items.
I tried tweaking the rangeExtractor by incrementing start and end indexes to compensate for this change, but its not correct because items are not necessarily scrolled out of the view on new message.
Is there a way to freeze the range properly?
code sandbox here: https://codesandbox.io/s/recursing-sun-inpkv2?file=/src/App.js:0-2950
Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions