header-footer demo bug with recycle item
panther7 opened this issue · comments
This code cause duplicating older items:
Following code fixing them:
virtualScroller.recycleElement = (element, item) => {
switch (element.tagName) {
case "HEADER":
nodePool.group.push(element);
break;
case "CONTACT-ELEMENT":
nodePool.contact.push(element);
break;
default: element.remove();
}
};
Confirmed, recycleElement receives unexpected data when invoked after user modifies the items array, here a smaller reproduction: https://jsbin.com/yogiwesoqu/1/edit?html,console,output
Note how the item.group
will not match with the element
type received as input after we alter the array
Closing this as this is related to the virtual-scroller
prototype implementation and we intend to make this repository focus on the standards side of it. See also: #158 (comment).
FYI we're going to have a separate demos repository later on, that can be used with Chromium's implementation of the new approach. Stay tuned for updates!