Skip to content

Commit 5f77639

Browse files
ADjenkovADjenkov
ADjenkov
authored and
ADjenkov
committed
fix(dialogs): unable to show nested frameless modal views
1 parent eb1a7f0 commit 5f77639

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: nativescript-angular/directives/dialogs.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ export class ModalDialogService {
6767
parentView = parentView.ngAppRoot;
6868
}
6969

70+
if (parentView._ngDialogRoot) {
71+
parentView = parentView._ngDialogRoot;
72+
}
73+
7074
const pageFactory: PageFactory = viewContainerRef.injector.get(PAGE_FACTORY);
7175

7276
// resolve from particular module (moduleRef)
@@ -76,7 +80,9 @@ export class ModalDialogService {
7680

7781
const frame = parentView.page && parentView.page.frame;
7882

79-
this.location._beginModalNavigation(frame);
83+
if (frame) {
84+
this.location._beginModalNavigation(frame);
85+
}
8086

8187
return new Promise((resolve, reject) => {
8288
setTimeout(() => {
@@ -144,6 +150,7 @@ export class ModalDialogService {
144150
componentView = detachedProxy.getChildAt(0);
145151

146152
if (componentView.parent) {
153+
(<any>componentView.parent)._ngDialogRoot = componentView;
147154
(<any>componentView.parent).removeChild(componentView);
148155
}
149156

0 commit comments

Comments
 (0)