mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
fix(frame-ios): tearDownUI when UINavigationController disappear (#6892)
This commit is contained in:

committed by
GitHub

parent
8330ac0ac1
commit
57f07a3ec7
@ -101,8 +101,11 @@ export function test_backAndForwardParentPage_nestedFrames() {
|
|||||||
helper.waitUntilNavigatedTo(parentPage1, () => frame.goBack());
|
helper.waitUntilNavigatedTo(parentPage1, () => frame.goBack());
|
||||||
currentPageMustBe("ParentPage1");
|
currentPageMustBe("ParentPage1");
|
||||||
|
|
||||||
helper.waitUntilNavigatedTo(parentPage2, () => topmost.navigate({ create: () => parentPage2 }));
|
const innerPage3 = page("InnerPage3");
|
||||||
currentPageMustBe("ParentPage2");
|
const parentPage3 = parentPage("ParentPage3", innerPage3);
|
||||||
|
|
||||||
|
helper.waitUntilNavigatedTo(parentPage3, () => topmost.navigate({ create: () => parentPage3 }));
|
||||||
|
currentPageMustBe("ParentPage3");
|
||||||
|
|
||||||
back(2);
|
back(2);
|
||||||
TKUnit.waitUntilReady(() => topmostFrame().navigationQueueIsEmpty());
|
TKUnit.waitUntilReady(() => topmostFrame().navigationQueueIsEmpty());
|
||||||
|
@ -37,6 +37,8 @@ export class Frame extends FrameBase {
|
|||||||
|
|
||||||
public disposeNativeView() {
|
public disposeNativeView() {
|
||||||
this._removeFromFrameStack();
|
this._removeFromFrameStack();
|
||||||
|
this.viewController = null;
|
||||||
|
this._ios.controller = null;
|
||||||
super.disposeNativeView();
|
super.disposeNativeView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,9 +391,8 @@ class UINavigationControllerImpl extends UINavigationController {
|
|||||||
const owner = this._owner.get();
|
const owner = this._owner.get();
|
||||||
if (owner && owner.isLoaded && !owner.parent && !this.presentedViewController) {
|
if (owner && owner.isLoaded && !owner.parent && !this.presentedViewController) {
|
||||||
owner.callUnloaded();
|
owner.callUnloaded();
|
||||||
|
owner._tearDownUI(true);
|
||||||
|
|
||||||
owner.viewController = null;
|
|
||||||
owner.ios.controller = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user