Merge pull request #212 from DioxusLabs/jk/remove-attr-dangerous

fix: add a check for dangerousinnerhtml in interpreter
This commit is contained in:
Jonathan Kelley 2022-02-05 21:32:30 -05:00 committed by GitHub
commit 92ec0a448f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,15 +141,17 @@ export class Interpreter {
}
RemoveAttribute(root, name) {
const node = this.nodes[root];
node.removeAttribute(name);
if (name === "value") {
node.value = "";
}
if (name === "checked") {
} else if (name === "checked") {
node.checked = false;
}
if (name === "selected") {
} else if (name === "selected") {
node.selected = false;
} else if (name == "dangerous_inner_html") {
node.innerHTML = "";
} else {
node.removeAttribute(name);
}
}
handleEdits(edits) {