Skip to content

Commit

Permalink
work around Edge issue when removing attributes during hydration (#4911)
Browse files Browse the repository at this point in the history
  • Loading branch information
aredridel authored Jun 8, 2020
1 parent 430961c commit 0dceb2c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/runtime/internal/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,16 @@ export function claim_element(nodes, name, attributes, svg) {
const node = nodes[i];
if (node.nodeName === name) {
let j = 0;
const remove = [];
while (j < node.attributes.length) {
const attribute = node.attributes[j];
if (attributes[attribute.name]) {
j++;
} else {
node.removeAttribute(attribute.name);
const attribute = node.attributes[j++];
if (!attributes[attribute.name]) {
remove.push(attribute.name);
}
}
for (let k = 0; k < remove.length; k++) {
node.removeAttribute(remove[k]);
}
return nodes.splice(i, 1)[0];
}
}
Expand Down

0 comments on commit 0dceb2c

Please sign in to comment.