diff options
Diffstat (limited to 'lib/src/runtime.ffi.mjs')
-rw-r--r-- | lib/src/runtime.ffi.mjs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/src/runtime.ffi.mjs b/lib/src/runtime.ffi.mjs index bab3a57..dd02f8b 100644 --- a/lib/src/runtime.ffi.mjs +++ b/lib/src/runtime.ffi.mjs @@ -181,6 +181,8 @@ function morphAttr(el, name, value, dispatch) { switch (typeof value) { case "string": if (el.getAttribute(name) !== value) el.setAttribute(name, value); + if (value === "") el.removeAttribute(name); + if (name === "value" && el.value !== value) el.value = value; break; // Event listeners need to be handled slightly differently because we need |