material icon indicating copy to clipboard operation
material copied to clipboard

md-list + infinite scroll capability

Open maksimlikharev opened this issue 11 years ago • 40 comments

I see more and more interesting controls got added to material design.

I'm pitching again for properly done infinite scrolling list in the context of angular materials, looks like the only known to me and somewhat correctly made infinite list is Polymer core-list, ng side needs such functionality too.

It has to be windowing, that is produce just enough DOM elements to cover display area + gaps and reused on scroll. It has to have proper async data delivery. It has to have rendering templates. It should have selection management. It has to be reactive and fast.

I can contribute my time if there is initial framework available.

maksimlikharev avatar Feb 28 '15 07:02 maksimlikharev

:+1: Agree! I was going to write here very similar thing today ;)

madvas avatar Mar 09 '15 09:03 madvas

I can put together a PR for ngMaterial if this will be merged in. @ThomasBurleson @rschmukler thoughts?

ilanbiala avatar Mar 09 '15 16:03 ilanbiala

Is there an update on this one?

robdefeo avatar Apr 06 '15 00:04 robdefeo

I have noticed it does not work when using md-scroll-shrink in md-toolbar it appears not to fire the infinite scroll

robdefeo avatar Apr 06 '15 14:04 robdefeo

any chance to play with the code, if it somewhat ready?

maksimlikharev avatar Apr 06 '15 18:04 maksimlikharev

Any new on this? It is a badly needed feature

csvan avatar Jun 02 '15 18:06 csvan

+1

ru-sh avatar Jun 19 '15 04:06 ru-sh

+1

ghost avatar Jun 24 '15 14:06 ghost

+1

sckoh avatar Jun 28 '15 10:06 sckoh

+1 Btw, is there a guideline for pagination in material design?

Clan-Utility avatar Jul 11 '15 14:07 Clan-Utility

Here is an CodePen Demo of a scrolling list with 100K rows; using md-virtual-repeat. While this is not infinite scroll, it does deliver performance and features for large lists.

largelists

The md-virtual-repeat component is available with v0.10.1-rc1 or greater

ThomasBurleson avatar Jul 11 '15 15:07 ThomasBurleson

If anyone is interested, a Pull-Request for infinite scroll would be welcome. The core team is focused on critical features required for v1.0 release.

ThomasBurleson avatar Jul 11 '15 15:07 ThomasBurleson

This is working great! Thank-you for adding it. My only question is I can't figure out how to flex the container to take the full height of the parent. I'm currently setting the height using javascript and listening to the window.resize event. That's working fine; I'm just wondering if there is an easier way.

DallanQ avatar Jul 14 '15 14:07 DallanQ

+1 There's currently no good virtual scroll angularjs component around that would allow non-container scrolling (a-ls Facebook and LinkedIn). Would be great to get one as part of the Material Design family!

oharlem avatar Jul 15 '15 04:07 oharlem

@kseamon - Referring to CodePen Demo, it appears that we must explicitly set the mdVirtualRepeatContainer height in CSS or JS.

Why does the container not calculate its size if I add a flex attribute (and remove the explicit height size)? e.g. <md-virtual-repeat-container id="vertical-container" flex>

ThomasBurleson avatar Jul 15 '15 09:07 ThomasBurleson

@ThomasBurleson I'd have to look into it, but it's probably a timing issue (e.g. the offsetHeight is not updated until after the container tries to read it. I'll need to add in some code that continues trying to get the height until it finds a non-zero value. Unfortunately this can be pretty costly, but there's probably no way around it.

kseamon avatar Jul 15 '15 11:07 kseamon

Also, see https://github.com/angular/material/issues/3416 (The gist is that I have some ideas for adding infinite scroll to md-virtual-repeat). @ThomasBurleson: Would we like to prioritize this higher than, say, incorporating virtual repeat into select and menu?

kseamon avatar Jul 15 '15 11:07 kseamon

As long as we're asking for things :-), if the virtual scroller could use the page scrollbar somehow, like google inbox and contacts, that would be wonderful. I think that's a better UX than having a separate scrollbar.

DallanQ avatar Jul 15 '15 15:07 DallanQ

https://github.com/angular/material/pull/4002

kseamon avatar Aug 04 '15 16:08 kseamon

@ThomasBurleson Now that infinite scroll is landed in virtual-repeat, are we good to close this issue?

kseamon avatar Sep 09 '15 13:09 kseamon