From f64f74fb7b61d16fc7c6624b7d9e02bb430b3197 Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Tue, 27 Dec 2016 15:26:55 +0200 Subject: [PATCH] Fix: Trying to clear inherited props after the view has been detached throws --- tns-core-modules/ui/core/view-base.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tns-core-modules/ui/core/view-base.ts b/tns-core-modules/ui/core/view-base.ts index ea258f2ff..952f13974 100644 --- a/tns-core-modules/ui/core/view-base.ts +++ b/tns-core-modules/ui/core/view-base.ts @@ -424,6 +424,7 @@ export class ViewBase extends Observable implements ViewBaseDefinition { throw new Error("View not added to this instance. View: " + view + " CurrentParent: " + view.parent + " ExpectedParent: " + this); } + clearInheritedProperties(view); this._removeViewCore(view); view.parent = undefined; view._parentChanged(this); @@ -473,10 +474,6 @@ export class ViewBase extends Observable implements ViewBaseDefinition { public _parentChanged(oldParent: ViewBase): void { //Overridden - if (oldParent) { - // Move these method in property class. - clearInheritedProperties(this); - } } public _registerAnimation(animation: KeyframeAnimation) {