Skip to content

Commit

Permalink
clear fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Jun 25, 2019
1 parent 974a910 commit c4323e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions template/runtime.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c4323e9

Please sign in to comment.