diff --git a/package.json b/package.json index e8bf3e3..fda130f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cample", - "version": "3.1.2", + "version": "3.1.3", "description": "Cample.js - moderately fast reactive javascript framework. Reactivity without Virtual DOM!", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/core/components/each/each.ts b/src/core/components/each/each.ts index 0a7727f..677ad69 100644 --- a/src/core/components/each/each.ts +++ b/src/core/components/each/each.ts @@ -664,6 +664,7 @@ export class Each extends DataComponent { for (let i = 0; newFirstIndex < newLastIndex--; i++) { const currentIndex = newFirstIndex + i; const currentNewNode = newData[currentIndex]; + const newKey = getCurrentKey(currentNewNode, currentIndex); const { el, currentNode } = createElement( currentNewNode, index, @@ -673,7 +674,7 @@ export class Each extends DataComponent { isFirst, currentIndex, importData, - currentNewNode + newKey ); if (currentNode) { setElement(