googlearchive / core-list

Polymer virtualized list element
25 stars 20 forks source link

Calls to scrollToItem() near end of list shrink list height #91

Closed Ortham closed 7 years ago

Ortham commented 9 years ago

This is related to #49 and #65 (which is a duplicate of the former). If scrollToItem() is used to jump to an element near the bottom of the list (ie. it is visible when the list is manually scrolled to the end), the elements above it are not displayed: this is #49.

If the call to scrollToItem() is repeated though, the height of the list is reduced with each call until the item is positioned at scrollTop. If the list is very short, ie. less than two container element heights, the first call may be enough to reach scrollTop.

There's also the problem that this moving to scrollTop doesn't seem to take into account the value of _aboveSize, which means that if the <core-list> is using its parent as the scrollTarget, and the parent has other elements above the <core-list>, they'll get overlapped with the <core-list> items.

This can be replicated on the <core-list> demo page: just delete the 50,000 rows generated by default and add a small number of new rows, then start calling scrollToItem() on them through the console.

Ortham commented 7 years ago

Closing this as it's obsolete.