work around Edge issue when removing attributes during hydration (#4911)

pull/4994/head
Aria Stewart 5 years ago committed by GitHub
parent 430961cc94
commit 0dceb2c281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -155,13 +155,15 @@ 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];
}

Loading…
Cancel
Save