vue-virtual-scroller
vue-virtual-scroller copied to clipboard
Adding to beginning of items
When items are added to the beginning of the items array the scroller displays the first items rather than staying put
Just commenting so I get notified about any comments on this thread.
I've implemented a rather hackish workaround for this to calculate how far from the bottom of the list a user is scrolled before adding items the the underlying array, then forcing the position back to about where it was (in a bunch of nested $nextTicks so it doesn't jump around), but the code for it is a right mess :flushed:
When items are added to the beginning of the items array the scroller displays the first items rather than staying put
This is standard scroll behavior in browsers.
@texh I'd love to see that code to save me writing it myself 😀
@Akryum it would be good to have a choice of what behaviour you wanted
The virtual scroller is not responsible for this behavior. 😸
It's possible to <DynamicScroller ref="scroller"> and use it's $refs.scroller.scrollToItem(index) function and scroll to desired index if You know how many items where prepended to the list but the animation still is
It's possible to
<DynamicScroller ref="scroller">and use it's$refs.scroller.scrollToItem(index)function and scroll to desired index if You know how many items where prepended to the list but the animation still is
But that might cause flickering...