mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
fix(android): nested dialog/fragment handling
This commit is contained in:
@ -356,6 +356,9 @@ export class View extends ViewCommon {
|
||||
}
|
||||
|
||||
public _getFragmentManager(): androidx.fragment.app.FragmentManager {
|
||||
if ((<any>global)._dialogFragment) {
|
||||
return (<any>global)._dialogFragment.getChildFragmentManager();
|
||||
}
|
||||
let manager = this._manager;
|
||||
if (!manager) {
|
||||
let view: View = this;
|
||||
@ -708,18 +711,20 @@ export class View extends ViewCommon {
|
||||
saveModal(dialogOptions);
|
||||
|
||||
this._dialogFragment = df;
|
||||
(<any>global)._dialogFragment = df;
|
||||
this._raiseShowingModallyEvent();
|
||||
|
||||
this._dialogFragment.show(parent._getRootFragmentManager(), this._domId.toString());
|
||||
}
|
||||
|
||||
protected _hideNativeModalView(parent: View, whenClosedCallback: () => void) {
|
||||
const manager = this._dialogFragment.getFragmentManager();
|
||||
const manager = this._dialogFragment.getParentFragmentManager();
|
||||
if (manager) {
|
||||
this._dialogFragment.dismissAllowingStateLoss();
|
||||
}
|
||||
|
||||
this._dialogFragment = null;
|
||||
(<any>global)._dialogFragment = null;
|
||||
whenClosedCallback();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user