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 all 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
9 changes: 9 additions & 0 deletions core/src/utils/framework-delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ 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 = 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.
el.append(...BaseComponent.children);
// Append the new parent element to the original parent element.
BaseComponent.appendChild(el);
}

/**
Expand Down