WICG / virtual-scroller

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Headers/footers demo with dismissable list items

panther7 opened this issue · comments

Heya, this turned out being harder than expected, but here's a working jsbin https://jsbin.com/qirokegoti/1/edit?html,output
I reproduced #150 as well, it seems that after we update the array, the following calls to recycleElement will receive an element that is configured with a different item, not the one passed as input. I'll add a smaller repro in that bug, hope this jsbin helps!
I used a <template> to hold the definition of contact elements, and clone a copy each time we need a new one.
Another gotcha - you want to define a itemKey for the item source, so that virtual-scroller can properly distinguish the 2 types; i used the group_ and contact_ as prefixes.

It probably makes sense to add this as a demo to the repository - this is a pretty good example

We currently are trying to make this repository focus on the standards side of virtual-scroller, so I am closing this. See also: #158 (comment).

We're going to have a separate demos repository later on, so maybe will move this issue there?