[Feature Request] Fire events in v-virtual-scroll
See original GitHub issueProblem to solve
According to the docs, v-virtual-scroll
doesn’t fire any events, but it would be nice if it would fire one if it (almost) reaches the end of its items stream. You could hook this into a fetching function that retrieves more items and easily implement ‘infinite scrolling’ this way.
Proposed solution
When v-virtual-scroll
reaches the end of its items stream, fire an event that designates this (for instance $emit('end-of-stream')
). One could even make it configurable at how many items before the end of the stream the event should be fired?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Virtual scrolling: Core principles and basic implementation in ...
Learn how to implement virtual scrolling in React. ... The scroller will request the data via this method, ... Scroll event handling.
Read more >Infinite Virtual Scroll with the Angular CDK - Fireship
The component emits a custom event whenever the scrolled index changes. This allows you to run code when a specific item is scrolled...
Read more >Grid with remote virtual scrolling fires mutiple read requests ...
Hi, When using the Grid with remote datasource and virtual scrolling, the grid often fires 2 or more of the same read request,...
Read more >Angular 7 Virtual Scroll - To Infinity and Beyond - YouTube
Learn how to use the new Virtual Scroll behavior in Angular CDK v7 to build a list that is infinite, animated, and realtime...
Read more >Build your own virtual scroll - Part II
Scroll events can fire very rapidly as the user scrolls, ... an animation and requests that the browser shall call a specified function...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright @KaelWD, your suggestion lead me into the right direction. I indeed had to listen to the native scroll event of
v-virtual-scroll
, e.g.Then the script to fire an event at the end of the stream is as follows:
which did the trick. One could add a margin to the end area, so that items can already be fetched before the end of the current stream is reached, e.g.:
All in all, this was indeed relatively easy to achieve, but I still think this would be a worthwhile addition to the library 😄
Hey guys, how do you scroll to an specific item on the list programatically?