mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 18:17:31 +08:00
fix(angular): inline modals now add .ion-page class correctly (#24751)
resolves #24750
This commit is contained in:
@ -73,7 +73,7 @@ export declare interface IonModal extends Components.IonModal {
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-modal',
|
selector: 'ion-modal',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
template: `<ng-container [ngTemplateOutlet]="template" *ngIf="isCmpOpen"></ng-container>`,
|
template: `<div class="ion-page"><ng-container [ngTemplateOutlet]="template" *ngIf="isCmpOpen"></ng-container></div>`,
|
||||||
inputs: [
|
inputs: [
|
||||||
'animated',
|
'animated',
|
||||||
'backdropBreakpoint',
|
'backdropBreakpoint',
|
||||||
|
@ -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(3)').should('have.text', 'C');
|
||||||
cy.get('ion-list ion-item:nth-child(4)').should('have.text', 'D');
|
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');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -89,7 +89,7 @@ export const CoreDelegate = () => {
|
|||||||
BaseComponent.appendChild(el);
|
BaseComponent.appendChild(el);
|
||||||
|
|
||||||
await new Promise(resolve => componentOnReady(el, resolve));
|
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
|
// If there is no component, then we need to create a new parent
|
||||||
// element to apply the css classes to.
|
// element to apply the css classes to.
|
||||||
const el = BaseComponent.ownerDocument && BaseComponent.ownerDocument.createElement('div');
|
const el = BaseComponent.ownerDocument && BaseComponent.ownerDocument.createElement('div');
|
||||||
|
Reference in New Issue
Block a user