WICG / virtual-scroller

Other
2k stars 83 forks source link

Headers/footers demo with dismissable list items #151

Closed panther7 closed 5 years ago

panther7 commented 5 years ago
  1. https://valdrinkoshi.github.io/virtual-scroller/demo/header-footer.html
  2. https://valdrinkoshi.github.io/virtual-scroller/demo/dismissable/

Problem is more items type. Could Someone help me with?

valdrinkoshi commented 5 years ago

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.

kenchris commented 5 years ago

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

rakina commented 5 years ago

We currently are trying to make this repository focus on the standards side of virtual-scroller, so I am closing this. See also: https://github.com/valdrinkoshi/virtual-scroller/issues/158#issuecomment-480913127.

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