Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature Request] Infinite scrolling in lists / tables #3538

Closed
fima-taf opened this issue Mar 11, 2018 · 12 comments · Fixed by #15590
Closed

[Feature Request] Infinite scrolling in lists / tables #3538

fima-taf opened this issue Mar 11, 2018 · 12 comments · Fixed by #15590

Comments

@fima-taf
Copy link

New Functionality

Currently there is no support for infinite scrolling, only normal pagination (by pages).
Infinite scrolling is being used in many apps / websites / supported by many frameworks and gaining popularity pretty fast.
Scroll in a list / table until you reach the bottom of the list / table and then load another bulk of items instead of splitting it into pages.

Improvements

  • No need to mess with pagination, pages, filters, etc.
  • Can avoid bugs related to pages / filters.
  • High popularity.
  • Cleaner view.

Bugs or Edge Cases it Helps Avoid

I think it can reduce the amount of bugs related to traditional pagination, but i don't think it will produce more bugs.

@johnleider johnleider added the T: feature A new feature label Mar 11, 2018
@scp-nm
Copy link

scp-nm commented Mar 13, 2018

I'm not sure Vuetify needs this as there are plenty of libraries out there already. Today I implemented https://github.com/egoist/vue-mugen-scroll on a list without too much hassle, and was even able to utilise the Vuetify progress component. Just my 2c...

@0ip
Copy link

0ip commented Mar 22, 2018

@scp-nm There certainly are libraries that work quite well for infinite scrolling, like https://github.com/wangdahoo/vue-scroller or the one you mentioned, but they lack a "pull to refresh" functionality that also works at the bottom of a list. I haven't found any component that supports this feature and works with Vuetify.

@skjortan23

This comment has been minimized.

@nseb

This comment has been minimized.

@Twinsen343
Copy link

Twinsen343 commented Sep 3, 2019

this would be a great feature, pagination in my limited knowledge seems a bit old school - especially in projects who have moved away from datatables and into cards
EDIT:
So you can sort of do your own infinite scroll if you have all desired items in an array -> Spice your array by an initial offset and just put on a simple watch function to detect if at bottom of page if at bottom of page then just increase your offset by X amount and show a spinner if desired -> this achieves the same result to the end-user by having all data there but not getting the performance hit by rendering everything at once.

@sab-exp
Copy link

sab-exp commented Sep 19, 2019

@Twinsen343 How do you detect the bottom of the pages in mobile ? For PC, this code works but not for mobile:
let element = document.documentElement
let bottomOfWindow = document.documentElement.scrollTop + window.innerHeight === document.documentElement.offsetHeight;
if (bottomOfWindow) { //appending data to the array }

@jimmywarting
Copy link

jimmywarting commented Sep 28, 2019

@Sabbir-Noire a good infinity pagination would use Intersection Observer API on both phone and desktop and not doing any calculations based on offsetHeight

@marceloavf
Copy link

I think this now should be easier with the new v-intersect (directive) in vuetify

@msalahz

This comment has been minimized.

@gedkirkham

This comment has been minimized.

@johnleider
Copy link
Member

This is something that we intend to implement using our v-virtual-scroller component. It was introduced very late into the game though and proved to be more difficult than expected to integrate into existing features. Thank you for your patience.

If you have any additional questions, please reach out to us in our Discord community.

@johnleider johnleider added this to the v3.x.x milestone Nov 19, 2020
@mrodal
Copy link
Contributor

mrodal commented Feb 14, 2021

Hi, for the time being, I made a simple InfiniteScroll component that can work as is or as base for someone who needs more functionality. Maybe it can be useful to someone

Here it is:
https://gist.github.com/mrodal/56952b72f6d378b3c263da506d002289

nekosaur added a commit that referenced this issue Aug 7, 2022
@KaelWD KaelWD modified the milestones: v3.x.x, v3.1.0 Aug 7, 2022
nekosaur added a commit that referenced this issue Aug 28, 2022
nekosaur added a commit that referenced this issue Oct 15, 2022
@KaelWD KaelWD closed this as completed Jan 6, 2023
@KaelWD KaelWD reopened this Mar 20, 2023
@KaelWD KaelWD removed this from the v3.1.0 (Valkyrie) milestone Mar 20, 2023
@KaelWD KaelWD added this to the v3.2.0 (Orion) milestone Mar 20, 2023
johnleider pushed a commit that referenced this issue Apr 10, 2023
johnleider added a commit that referenced this issue Apr 25, 2023
closes #3538

Co-authored-by: John Leider <john@vuetifyjs.com>
Co-authored-by: Kael <kaelwd@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment