mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-09 13:07:37 +08:00
Correctly handle boolean attributes with data-keep-attribute
This commit is contained in:
parent
37cb549d02
commit
2e17ad48d6
1 changed files with 5 additions and 1 deletions
|
@ -8,7 +8,11 @@ const callbacks = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attr.name === "data-keep-attribute") {
|
if (attr.name === "data-keep-attribute") {
|
||||||
to.setAttribute(attr.value, from.getAttribute(attr.value));
|
if (from.hasAttribute(attr.value)) {
|
||||||
|
to.setAttribute(attr.value, from.getAttribute(attr.value));
|
||||||
|
} else {
|
||||||
|
to.removeAttribute(attr.value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue