Skip to content

Commit 8c80044

Browse files
ADjenkovSvetoslavTsenov
authored andcommitted
fix(view-android): clear dialog fragment when closing modal view (NativeScript#6852)
1 parent fdebf04 commit 8c80044

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tns-core-modules/ui/core/view/view.android.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ function initializeDialogFragment() {
9191
return global.__native(this);
9292
}
9393

94+
public onDetachedFromWindow(): void {
95+
super.onDetachedFromWindow();
96+
this.fragment = null;
97+
};
98+
9499
public onBackPressed(): void {
95100
const view = this.fragment.owner;
96101
const args = <AndroidActivityBackPressedEventData>{
@@ -136,9 +141,8 @@ function initializeDialogFragment() {
136141
this._stretched = options.stretched;
137142
this._dismissCallback = options.dismissCallback;
138143
this._shownCallback = options.shownCallback;
139-
this.owner._dialogFragment = this;
140144
this.setStyle(android.support.v4.app.DialogFragment.STYLE_NO_TITLE, 0);
141-
145+
142146
let theme = this.getTheme();
143147
if (this._fullscreen) {
144148
// In fullscreen mode, get the application's theme.

0 commit comments

Comments
 (0)