Skip to content

Commit

Permalink
Fix optimized clear all path
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed May 17, 2019
1 parent 7cd605f commit 3c7a832
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mobx-jsx",
"description": "Raw MobX performance without the restraints of a Virtual DOM",
"version": "0.4.1",
"version": "0.4.2",
"author": "Ryan Carniato",
"license": "MIT",
"repository": {
Expand All @@ -18,7 +18,7 @@
"devDependencies": {
"@babel/core": "7.4.3",
"@babel/preset-typescript": "7.3.3",
"dom-expressions": "0.8.2",
"dom-expressions": "0.8.4",
"hyper-dom-expressions": "~0.8.0",
"lit-dom-expressions": "~0.8.0",
"mobx": "^5.9.0",
Expand Down
6 changes: 3 additions & 3 deletions src/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function eventHandler(e) {
handler(e, model);
if (e.cancelBubble) return;
}
node = node.host || node.parentNode;
node = (node.host && node.host instanceof Node) ? node.host : node.parentNode;
}
}

Expand Down Expand Up @@ -366,8 +366,8 @@ export function each(parent, accessor, expr, options, afterNode) {

// Fast path for clear
if (length === 0 || isFallback) {
if (beforeNode !== undefined || afterNode !== undefined) {
let node = beforeNode != undefined ? beforeNode.nextSibling : parent.firstChild;
if (beforeNode || afterNode) {
let node = beforeNode ? beforeNode.nextSibling : parent.firstChild;
removeNodes(parent, node, afterNode === undefined ? null : afterNode);
} else parent.textContent = "";
disposeAll();
Expand Down

0 comments on commit 3c7a832

Please sign in to comment.