Skip to content

Commit a609c94

Browse files
committed
make magic respect keys
1 parent 37806d4 commit a609c94

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/magic.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ export function updateChildren(root, valMap = {}) {
6969
updateMap(valMap, child.nodeName);
7070
child.setAttribute(
7171
'data-key',
72-
`${child.nodeName}-${valMap[child.nodeName]}`
72+
'key' in child.dataset
73+
? child.dataset.key
74+
: `${child.nodeName}-${valMap[child.nodeName]}`
7375
);
7476
}
7577
if (child.nodeType === 3) {

0 commit comments

Comments
 (0)