diff --git a/angular/src/directives/overlays/modal.ts b/angular/src/directives/overlays/modal.ts index d0378b4eac..0032506c82 100644 --- a/angular/src/directives/overlays/modal.ts +++ b/angular/src/directives/overlays/modal.ts @@ -73,7 +73,7 @@ export declare interface IonModal extends Components.IonModal { @Component({ selector: 'ion-modal', changeDetection: ChangeDetectionStrategy.OnPush, - template: ``, + template: `
`, inputs: [ 'animated', 'backdropBreakpoint', diff --git a/angular/test/test-app/e2e/src/modal.spec.ts b/angular/test/test-app/e2e/src/modal.spec.ts index 67b65576a2..410a6cfd75 100644 --- a/angular/test/test-app/e2e/src/modal.spec.ts +++ b/angular/test/test-app/e2e/src/modal.spec.ts @@ -60,4 +60,8 @@ describe('Modals: Inline', () => { cy.get('ion-list ion-item:nth-child(3)').should('have.text', 'C'); cy.get('ion-list ion-item:nth-child(4)').should('have.text', 'D'); }); + + it('should have a div with .ion-page', () => { + cy.get('ion-modal').children('.ion-page').should('exist'); + }); }); diff --git a/core/src/utils/framework-delegate.ts b/core/src/utils/framework-delegate.ts index 0482ceaa47..b12a7a2f5c 100644 --- a/core/src/utils/framework-delegate.ts +++ b/core/src/utils/framework-delegate.ts @@ -89,7 +89,7 @@ export const CoreDelegate = () => { BaseComponent.appendChild(el); await new Promise(resolve => componentOnReady(el, resolve)); - } else { + } else if (BaseComponent.children.length > 0) { // If there is no component, then we need to create a new parent // element to apply the css classes to. const el = BaseComponent.ownerDocument && BaseComponent.ownerDocument.createElement('div');