Fixed a minor issue with attachOnDisconnect for the list template.

This commit is contained in:
MattMo 2023-10-17 15:32:22 -07:00
parent f4e314c7be
commit a584eb68a7

View File

@ -2378,12 +2378,13 @@ class list extends IgniteTemplate {
if (this.list) {
for (var i = 0; i < this.list.length; i++) {
var template = this.forEachCallback(this.list[i], i, this.list.length);
if (template) {
template.construct(parent, this.element);
//If we are reflecting, attach to the elements disconnect event.
if (this.reflecting) {
this.reflectCallbacks.push(template.element.attachOnDisconnect(disconnect => this.onItemRemove(this.list[i])));
this.reflectCallbacks.push(template.element.attachOnDisconnect(() => this.onItemRemove(this.list[i])));
}
this.children.push(template);