fix(android): nested dialog/fragment handling

This commit is contained in:
Nathan Walker
2021-08-15 11:31:50 -07:00
parent 66203d24ee
commit 6822115cff

View File

@ -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();
}