mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(frame): root tabview with modal frame when suspend/resume app (#5408)
This commit is contained in:
@@ -263,6 +263,10 @@ export abstract class ViewBase extends Observable {
|
||||
*/
|
||||
public _removeViewCore(view: ViewBase): void;
|
||||
public _parentChanged(oldParent: ViewBase): void;
|
||||
/**
|
||||
* Method is intended to be overridden by inheritors and used as "protected"
|
||||
*/
|
||||
public _dialogClosed(): void;
|
||||
|
||||
_domId: number;
|
||||
|
||||
|
||||
@@ -956,6 +956,10 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
|
||||
parent.closeModal();
|
||||
}
|
||||
}
|
||||
|
||||
public _dialogClosed(): void {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ViewBase.prototype.isCollapsed = false;
|
||||
|
||||
@@ -251,10 +251,12 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
|
||||
const modalIndex = _rootModalViews.indexOf(that);
|
||||
_rootModalViews.splice(modalIndex);
|
||||
that._hideNativeModalView(parent);
|
||||
that._modalParent = null
|
||||
that._modalParent = null;
|
||||
that._modalContext = null;
|
||||
that._closeModalCallback = null;
|
||||
that._dialogClosed();
|
||||
parent._modal = null;
|
||||
|
||||
if (typeof closeCallback === "function") {
|
||||
closeCallback.apply(undefined, arguments);
|
||||
}
|
||||
|
||||
@@ -58,18 +58,10 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
|
||||
@profile
|
||||
public onLoaded() {
|
||||
super.onLoaded();
|
||||
|
||||
this._pushInFrameStack();
|
||||
|
||||
this._processNextNavigationEntry();
|
||||
}
|
||||
|
||||
@profile
|
||||
public onUnloaded() {
|
||||
super.onUnloaded();
|
||||
|
||||
this._popFromFrameStack();
|
||||
}
|
||||
|
||||
public canGoBack(): boolean {
|
||||
let backstack = this._backStack.length;
|
||||
let previousForwardNotInBackstack = false;
|
||||
@@ -192,6 +184,8 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
|
||||
// app.on(app.orientationChangedEvent, (data) => this._onOrientationChanged());
|
||||
// }
|
||||
|
||||
this._pushInFrameStack();
|
||||
|
||||
const backstackEntry: BackstackEntry = {
|
||||
entry: entry,
|
||||
resolvedPage: page,
|
||||
@@ -430,6 +424,10 @@ export class FrameBase extends CustomLayoutView implements FrameDefinition {
|
||||
this._isInFrameStack = false;
|
||||
}
|
||||
|
||||
public _dialogClosed(): void {
|
||||
this._popFromFrameStack();
|
||||
}
|
||||
|
||||
get _childrenCount(): number {
|
||||
if (this.currentPage) {
|
||||
return 1;
|
||||
|
||||
@@ -243,7 +243,9 @@ export class Frame extends FrameBase {
|
||||
if (this.canGoBack()) {
|
||||
this.goBack();
|
||||
return true;
|
||||
} else if (!this.navigationQueueIsEmpty()) {
|
||||
}
|
||||
|
||||
if (!this.navigationQueueIsEmpty()) {
|
||||
const manager = this._getFragmentManager();
|
||||
if (manager) {
|
||||
manager.executePendingTransactions();
|
||||
|
||||
Reference in New Issue
Block a user