feat: handle bool attrs properly
This commit is contained in:
1 parent
14da441c7b
commit
8d685f40b7
2 files changed
+14
-2
No files matched your search
@@ -369,7 +369,11 @@ class Interpreter {
|
||||
node.innerHTML = value;
|
||||
break;
|
||||
default:
|
||||
node.setAttribute(name, value);
|
||||
if (value == "false") {
|
||||
node.removeAttribute(name);
|
||||
} else {
|
||||
node.setAttribute(name, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,7 +347,15 @@ impl WebsysDom {
|
||||
fallback();
|
||||
}
|
||||
}
|
||||
_ => fallback(),
|
||||
_ => {
|
||||
if value == "false" {
|
||||
if let Some(el) = node.dyn_ref::<Element>() {
|
||||
let _ = el.remove_attribute(name);
|
||||
}
|
||||
} else {
|
||||
fallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user