Skip to content

Commit 7d71b08

Browse files
Use "set" instead of "splice" for child changed
When using firebase-collection in a dom-repeat, the whole template has to refresh every time a child changes instead of only the modified child. That's because it is updating the array with a splice. If we use a set instead, only the actual child is refreshed. The main problem with the "splice" was that I was losing focus on an input when the refresh was happening. *fixed coding style
1 parent 61acce8 commit 7d71b08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

firebase-collection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ <h4>[[dinosaur.__firebaseKey__]]</h4>
586586

587587
this._valueMap[oldValue.__firebaseKey__] = null;
588588
this._valueMap[value.__firebaseKey__] = value;
589-
this.splice('data', this.data.indexOf(oldValue), 1, value);
589+
this.set('data.' + this.data.indexOf(oldValue), value);
590590
});
591591
},
592592

0 commit comments

Comments
 (0)