diff options
author | Joris | 2023-02-19 13:23:19 +0100 |
---|---|---|
committer | Joris | 2023-02-19 13:25:52 +0100 |
commit | 46950ed9e9f513c37366347e8eb7cc5295591864 (patch) | |
tree | f496ad6ee322906b6ccd4b5148519646b40dab4b /src/rx.ts | |
parent | 0267049f29374f0114bef23a5982c930c4d2bedb (diff) |
Fix setting an attribute to false
Diffstat (limited to 'src/rx.ts')
-rw-r--r-- | src/rx.ts | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -463,11 +463,17 @@ function appendNode(base: Element, node: Node, lastAdded?: Node) { } function setAttribute(state: State, element: Element, key: string, attribute: AttributeValue) { - if (attribute === undefined || attribute === false) { + if (attribute === undefined) { // Do nothing } else if (attribute === true) { // @ts-ignore - element[key] = "true" + element[key] = 'true' + } else if (attribute === false) { + // @ts-ignore + if (key in element) { + // @ts-ignore + element[key] = false + } } else if (typeof attribute === "number") { // @ts-ignore element[key] = attribute.toString() |