Skip to content

Commit

Permalink
make magic respect keys
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwheeler committed May 4, 2018
1 parent 37806d4 commit a609c94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/magic.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export function updateChildren(root, valMap = {}) {
updateMap(valMap, child.nodeName);
child.setAttribute(
'data-key',
`${child.nodeName}-${valMap[child.nodeName]}`
'key' in child.dataset
? child.dataset.key
: `${child.nodeName}-${valMap[child.nodeName]}`
);
}
if (child.nodeType === 3) {
Expand Down

0 comments on commit a609c94

Please sign in to comment.