Comparing version 2.1.3 to 2.2.0
@@ -383,2 +383,4 @@ 'use strict'; | ||
value: function disconnectedCallback() { | ||
var _this2 = this; | ||
if (!this.initialized) { | ||
@@ -401,9 +403,21 @@ return; | ||
this.$panelRoot = null; | ||
this.$panelParent = null; | ||
this.appState = null; | ||
this.app = null; | ||
this.domPatcher = null; | ||
this._rendered = null; | ||
this.initialized = false; | ||
// if a child component is added via child() and has keys, snabbdom uses parentEl.insertBefore | ||
// which disconnects the element and immediately connects it at another position. | ||
// usually the child's disconnectedCallback is called before the parent's | ||
// but in that case the parents are removed from dom before the children | ||
// which causes a $panelParent not found exception for the grandchildren. | ||
// we clean up parent references in an async manner so we can handle that situation. | ||
Promise.resolve().then(function () { | ||
// only clear references if element hasn't been re-initialized | ||
if (!_this2.initialized) { | ||
_this2.$panelRoot = null; | ||
_this2.$panelParent = null; | ||
_this2.appState = null; | ||
_this2.app = null; | ||
} | ||
}); | ||
} | ||
@@ -410,0 +424,0 @@ |
@@ -327,9 +327,21 @@ import cuid from 'cuid'; | ||
this.$panelRoot = null; | ||
this.$panelParent = null; | ||
this.appState = null; | ||
this.app = null; | ||
this.domPatcher = null; | ||
this._rendered = null; | ||
this.initialized = false; | ||
// if a child component is added via child() and has keys, snabbdom uses parentEl.insertBefore | ||
// which disconnects the element and immediately connects it at another position. | ||
// usually the child's disconnectedCallback is called before the parent's | ||
// but in that case the parents are removed from dom before the children | ||
// which causes a $panelParent not found exception for the grandchildren. | ||
// we clean up parent references in an async manner so we can handle that situation. | ||
Promise.resolve().then(() => { | ||
// only clear references if element hasn't been re-initialized | ||
if (!this.initialized) { | ||
this.$panelRoot = null; | ||
this.$panelParent = null; | ||
this.appState = null; | ||
this.app = null; | ||
} | ||
}); | ||
} | ||
@@ -336,0 +348,0 @@ |
{ | ||
"name": "panel", | ||
"version": "2.1.3", | ||
"version": "2.2.0", | ||
"description": "Web Components with Virtual DOM: lightweight composable web apps", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
136019
2884