Skip to content

Commit 57f07a3

Browse files
authored
fix(frame-ios): tearDownUI when UINavigationController disappear (#6892)
1 parent 8330ac0 commit 57f07a3

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎tests/app/navigation/navigation-tests.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ export function test_backAndForwardParentPage_nestedFrames() {
101101
helper.waitUntilNavigatedTo(parentPage1, () => frame.goBack());
102102
currentPageMustBe("ParentPage1");
103103

104-
helper.waitUntilNavigatedTo(parentPage2, () => topmost.navigate({ create: () => parentPage2 }));
105-
currentPageMustBe("ParentPage2");
104+
const innerPage3 = page("InnerPage3");
105+
const parentPage3 = parentPage("ParentPage3", innerPage3);
106+
107+
helper.waitUntilNavigatedTo(parentPage3, () => topmost.navigate({ create: () => parentPage3 }));
108+
currentPageMustBe("ParentPage3");
106109

107110
back(2);
108111
TKUnit.waitUntilReady(() => topmostFrame().navigationQueueIsEmpty());

‎tns-core-modules/ui/frame/frame.ios.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export class Frame extends FrameBase {
3737

3838
public disposeNativeView() {
3939
this._removeFromFrameStack();
40+
this.viewController = null;
41+
this._ios.controller = null;
4042
super.disposeNativeView();
4143
}
4244

@@ -389,9 +391,8 @@ class UINavigationControllerImpl extends UINavigationController {
389391
const owner = this._owner.get();
390392
if (owner && owner.isLoaded && !owner.parent && !this.presentedViewController) {
391393
owner.callUnloaded();
394+
owner._tearDownUI(true);
392395

393-
owner.viewController = null;
394-
owner.ios.controller = null;
395396
}
396397
}
397398

0 commit comments

Comments
 (0)