From c4323e9f82d1a783fb5c5998c2c40de6163d706a Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Mon, 24 Jun 2019 22:41:21 -0700 Subject: [PATCH] clear fix --- package-lock.json | 2 +- package.json | 2 +- template/runtime.ejs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 94c1e5d3..d34d9e4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "dom-expressions", - "version": "0.10.2", + "version": "0.10.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 65b11152..7733a6f2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "dom-expressions", "description": "A Fine-Grained Runtime for Performant DOM Rendering", - "version": "0.10.2", + "version": "0.10.3", "author": "Ryan Carniato", "license": "MIT", "repository": { diff --git a/template/runtime.ejs b/template/runtime.ejs index 4da6f9eb..f76f4949 100644 --- a/template/runtime.ejs +++ b/template/runtime.ejs @@ -259,7 +259,7 @@ export function when(parent, accessor, expr, options, marker) { const value = condition(); sample(() => { parent = (marker && marker.parentNode) || (beforeNode && beforeNode.parentNode) || parent; - clearAll(parent, current, marker, beforeNode && beforeNode.nextSibling); + clearAll(parent, current, marker !== undefined ? marker || (current ? step(current, FORWARD) : null) : marker, beforeNode && beforeNode.nextSibling); current = null; if (value == null || value === false) { afterRender && afterRender(current, marker); @@ -286,7 +286,7 @@ export function switchWhen(parent, conditions, _, options, marker) { const index = evalConditions(); sample(() => { parent = (marker && marker.parentNode) || (beforeNode && beforeNode.parentNode) || parent; - clearAll(parent, current, marker, beforeNode && beforeNode.nextSibling); + clearAll(parent, current, marker !== undefined ? marker || (current ? step(current, FORWARD) : null) : marker, beforeNode && beforeNode.nextSibling); current = null; if (index < 0) { if (fallback) { @@ -645,7 +645,7 @@ export function suspend(parent, accessor, expr, options, marker) { if (options.initializing) addNode(parent, rendered, marker || (beforeNode && beforeNode.nextSibling), ++groupCounter, node => current = node); else { if (disposable) { - clearAll(parent, current, marker, beforeNode && beforeNode.nextSibling); + clearAll(parent, current, marker !== undefined ? marker || (current ? step(current, FORWARD) : null) : marker, beforeNode && beforeNode.nextSibling); disposable(); } while (node = doc.body.firstChild) parent.insertBefore(node, marker);