diff options
author | Joris | 2023-02-12 12:35:09 +0100 |
---|---|---|
committer | Joris | 2023-02-12 12:35:09 +0100 |
commit | 2dc698c09a32d291ea83296f2e81edf182bb6de0 (patch) | |
tree | be990d78d2dc9ee2b00f3e751d51d88481313a28 /src/rx.ts | |
parent | d0431c7f81e20dfb77a6fe154292d6b06f433984 (diff) |
Fix double map child
The rx-base was not added at the right location, and not cleaned up.
Diffstat (limited to 'src/rx.ts')
-rw-r--r-- | src/rx.ts | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -328,8 +328,8 @@ function appendChild(state: State, element: Element, child: Child, lastAdded?: N lastAdded: appendRes.lastAdded } } else if (isRx(child)) { - const rxBase = document.createTextNode("") - element.append(rxBase) + const rxBase = document.createTextNode('') + appendNode(element, rxBase, lastAdded) let appendRes: AppendResult = { cancel: voidCancel, remove: voidRemove, @@ -345,7 +345,10 @@ function appendChild(state: State, element: Element, child: Child, lastAdded?: N appendRes.cancel() cancelRx() }, - remove: appendRes.remove, + remove: () => { + appendRes.remove() + element.removeChild(rxBase) + }, lastAdded: appendRes.lastAdded, } } else if (child === undefined || child === false) { |