Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(modal): inline modals inherit ion-page styling #24723

Merged
merged 4 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/src/components/modal/test/inline/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ test('modal: inline', async () => {
expect(modal).not.toBe(null);
await modal.waitForVisible();

const container = await modal.find('.ion-page');

expect(container).not.toBe(null);

screenshotCompares.push(await page.compareScreenshot());

await modal.callMethod('dismiss');
Expand Down
11 changes: 11 additions & 0 deletions core/src/utils/framework-delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ export const CoreDelegate = () => {
BaseComponent.appendChild(el);

await new Promise(resolve => componentOnReady(el, resolve));
} else {
// If there is no component, then we need to create a new parent
// element to apply the css classes to.
const el: HTMLElement = BaseComponent.ownerDocument && BaseComponent.ownerDocument.createElement('div');
cssClasses.forEach(c => el.classList.add(c));
// Move each child from the original template to the new parent element.
while (BaseComponent.hasChildNodes()) {
el.appendChild(BaseComponent.firstChild);
}
// Append the new parent element to the original parent element.
(BaseComponent as HTMLElement).appendChild(el);
sean-perkins marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down