render clears non-mithril dom nodes

This commit is contained in:
Pat Cavit 2016-08-05 14:03:34 -07:00
parent 5eb9c9010b
commit c92e24b7e1
4 changed files with 31 additions and 2 deletions

View file

@ -514,7 +514,12 @@ module.exports = function($window) {
function render(dom, vnodes) {
var hooks = []
var active = $doc.activeElement
if (dom.vnodes == null) dom.vnodes = []
// First time rendering into a node clears it out
if (dom.vnodes == null) {
dom.vnodes = []
dom.textContent = "";
}
if (!(vnodes instanceof Array)) vnodes = [vnodes]
updateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), hooks, null, undefined)