Components: virtual-scroll: allow setting the scrolled-to index

Created on 23 Feb 2018  路  4Comments  路  Source: angular/components

Add an input to the virtual scroll container that allows developers to set the index of the first element that should be visible in the viewport.

We should also allow specifying an index that is greater than the length of the currently loaded data. Once the data loads we can scroll to the specified index.

P3 cdscrolling feature

Most helpful comment

@mmalerba HI. Could you please approximately say when scrollToIndex method for autosize strategy will be implemented?

All 4 comments

I'd use this to do the actual scrolling:

        try {
          this._elementRef.nativeElement.scrollTo({ left: 0, top, behavior: 'smooth' });
        } catch (e) {
          // IE Sucks
          window.scrollTo(0, top);
        }

I think we need a scrollToItem and a scrollToOffset implementation.

@mmalerba HI. Could you please approximately say when scrollToIndex method for autosize strategy will be implemented?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Miiekeee picture Miiekeee  路  3Comments

michaelb-01 picture michaelb-01  路  3Comments

theunreal picture theunreal  路  3Comments

kara picture kara  路  3Comments

vitaly-t picture vitaly-t  路  3Comments