Preventing from scrolling on viewport height #52
Replies: 3 comments 13 replies
-
|
Hi, @spacepolice10 I'll try case with prepending a large data to the list. Will be good if you provide reproduction in codesandbox for example or some your code snippets |
Beta Was this translation helpful? Give feedback.
-
|
I added It something like firstItemIndex (thank you for reference) but represents difference between old and new start index. You can use any number you want in theory - the main rule is It works for me in Chrome for prepending items but require a little bit client code to update indexesShift for any prepending. |
Beta Was this translation helpful? Give feedback.
-
|
@spacepolice10 I published beta version of 7.0.0, this release includes indexesShift prop. You can try it. Be careful when upgrading since this 7.0.0 has a several breaking changes |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I'm not sure if there's a way to achieve something like this, but maybe. I have a component with ViewportList which always scrolls to the last element. It receives data twice. First one is cached from previous page. Second one — when additional data loaded. The problem is that additional data prepends the list. So I see how browser quickly gets me to the top of the page and then again at the position I set in ViewportList.
Maybe there's a way to stop that scroll to top action? Maybe there's a way to create some kind of extreme zero overscan so ViewportList prevents vieweport and DOM from height changes? I want it to stick to last element but without sacrificing loading additional data. Any help really appreciated. Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions