Skip to content

Commit

Permalink
ensure children are hydrated when creating a text node via optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Mar 30, 2017
1 parent 347d8b3 commit b40a71f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@
// Optimization: VNode only has one child that is text, and create it here
if (vnode.children.length === 1 && vnode.children[0].type === "#text") {
el.textContent = vnode.children[0].val;
vnode.children[0].meta.el = el.firstChild;
} else {
// Add all children
for (var i = 0; i < vnode.children.length; i++) {
Expand Down
Loading

0 comments on commit b40a71f

Please sign in to comment.