diff --git a/packages/core/ui/core/view-base/index.ts b/packages/core/ui/core/view-base/index.ts index 0e3212755e..5028125779 100644 --- a/packages/core/ui/core/view-base/index.ts +++ b/packages/core/ui/core/view-base/index.ts @@ -1264,7 +1264,7 @@ export abstract class ViewBase extends Observable { */ public destroyNode(forceDestroyChildren?: boolean): void { this.reusable = false; - this.callUnloaded(); + this.unloadView(this); this._tearDownUI(forceDestroyChildren); } @@ -1284,7 +1284,9 @@ export abstract class ViewBase extends Observable { if (!preserveNativeView) { this.eachChild((child) => { - child._tearDownUI(force); + // if we decided to tear down the current view, we should also tear down the children, even if they are reusable + // the developer is responsible to detach them if they need to reuse them somewhere else + child._tearDownUI(true); return true; });