Skip to content
Open
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
2 changes: 1 addition & 1 deletion core/src/components/content/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

.inner-scroll {
@include position(calc(var(--offset-top) * -1), 0px,calc(var(--offset-bottom) * -1), 0px);
@include padding(calc(var(--padding-top) + var(--offset-top)), var(--padding-end), calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom) + var(--ion-content-safe-area-padding-bottom, 0px)), var(--padding-start));
@include padding(calc(var(--padding-top) + var(--offset-top)), var(--padding-end), calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom) + var(--internal-content-safe-area-padding-bottom, 0px)), var(--padding-start));

position: absolute;

Expand Down
10 changes: 5 additions & 5 deletions core/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1517,12 +1517,12 @@ export class Modal implements ComponentInterface, OverlayInterface {
}

/**
* Sets --ion-content-safe-area-padding-bottom on the given ion-content
* Sets --internal-content-safe-area-padding-bottom on the given ion-content
* when no footer is present, so ion-content's .inner-scroll includes
* safe-area-bottom in its scroll padding. This keeps the modal background
* edge-to-edge while ensuring content scrolls clear of the system nav bar.
*
* --ion-content-safe-area-padding-bottom is an internal CSS property used
* --internal-content-safe-area-padding-bottom is an internal CSS property used
* only by this code path. It is not part of ion-content's public API and
* should not be set by consumers. The default of 0px makes it a no-op
* when unset, which is the expected state for ion-content used outside of
Expand All @@ -1534,17 +1534,17 @@ export class Modal implements ComponentInterface, OverlayInterface {
// padding. Custom modals with raw HTML are developer-controlled.
if (!contentEl || hasFooter) return;

contentEl.style.setProperty('--ion-content-safe-area-padding-bottom', 'var(--ion-safe-area-bottom, 0px)');
contentEl.style.setProperty('--internal-content-safe-area-padding-bottom', 'var(--ion-safe-area-bottom, 0px)');
}

/**
* Removes the internal --ion-content-safe-area-padding-bottom property
* Removes the internal --internal-content-safe-area-padding-bottom property
* from an already-located ion-content. Callers do their own
* findContentAndFooter() so they can also read hasFooter if needed.
*/
private clearContentSafeAreaPadding(contentEl: HTMLElement | null): void {
if (!contentEl) return;
contentEl.style.removeProperty('--ion-content-safe-area-padding-bottom');
contentEl.style.removeProperty('--internal-content-safe-area-padding-bottom');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/modal/test/safe-area/modal.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ configs({ modes: ['ios', 'md'], directions: ['ltr'] }).forEach(({ title, config
expect(wrapperPaddingBottom).toBe('');
expect(wrapperHeight).toBe('');

// ion-content should have --ion-content-safe-area-padding-bottom set so its
// ion-content should have --internal-content-safe-area-padding-bottom set so its
// .inner-scroll element includes safe-area in its bottom padding.
const content = modal.locator('ion-content');
const safeAreaPadding = await content.evaluate((el: HTMLElement) => {
return el.style.getPropertyValue('--ion-content-safe-area-padding-bottom');
return el.style.getPropertyValue('--internal-content-safe-area-padding-bottom');
});
expect(safeAreaPadding).toBe('var(--ion-safe-area-bottom, 0px)');
});
Expand Down
Loading