diff --git a/core/src/components/modal/animations/ios.enter.ts b/core/src/components/modal/animations/ios.enter.ts index 3c354938fc..388c704e0e 100644 --- a/core/src/components/modal/animations/ios.enter.ts +++ b/core/src/components/modal/animations/ios.enter.ts @@ -27,7 +27,7 @@ export const iosEnterAnimation = ( .addAnimation([backdropAnimation, wrapperAnimation]); if (presentingEl) { - const modalTransform = (presentingEl.tagName === 'ION-MODAL' && (presentingEl as HTMLIonModalElement).presentingElement !== undefined) ? '-10px' : 'calc(var(--ion-safe-area-top) + 10px)'; + const modalTransform = (presentingEl.tagName === 'ION-MODAL' && (presentingEl as HTMLIonModalElement).presentingElement !== undefined) ? '-10px' : 'max(30px, var(--ion-safe-area-top))'; const bodyEl = document.body; const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE; const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`; diff --git a/core/src/components/modal/animations/ios.leave.ts b/core/src/components/modal/animations/ios.leave.ts index 0daeb62a91..4cbf32ddd4 100644 --- a/core/src/components/modal/animations/ios.leave.ts +++ b/core/src/components/modal/animations/ios.leave.ts @@ -9,7 +9,7 @@ export const iosLeaveAnimation = ( baseEl: HTMLElement, presentingEl?: HTMLElement, duration = 500 - ): Animation => { +): Animation => { const backdropAnimation = createAnimation() .addElement(baseEl.querySelector('ion-backdrop')!) @@ -27,7 +27,7 @@ export const iosLeaveAnimation = ( .addAnimation([backdropAnimation, wrapperAnimation]); if (presentingEl) { - const modalTransform = (presentingEl.tagName === 'ION-MODAL' && (presentingEl as HTMLIonModalElement).presentingElement !== undefined) ? '-10px' : 'calc(var(--ion-safe-area-top) + 10px)'; + const modalTransform = (presentingEl.tagName === 'ION-MODAL' && (presentingEl as HTMLIonModalElement).presentingElement !== undefined) ? '-10px' : 'max(30px, var(--ion-safe-area-top))'; const bodyEl = document.body; const currentPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE; const presentingAnimation = createAnimation() diff --git a/core/src/components/modal/modal.ios.scss b/core/src/components/modal/modal.ios.scss index fa4347bdca..590892088d 100644 --- a/core/src/components/modal/modal.ios.scss +++ b/core/src/components/modal/modal.ios.scss @@ -27,5 +27,5 @@ :host(.modal-card) .modal-wrapper { @include border-radius($modal-ios-border-radius, $modal-ios-border-radius, 0, 0); - height: calc(100% - var(--ion-safe-area-top) - 20px); + height: calc(100% - max(30px, var(--ion-safe-area-top)) - 10px); } \ No newline at end of file diff --git a/core/src/components/modal/test/spec/index.html b/core/src/components/modal/test/spec/index.html index 8514c1d261..55d838cc26 100644 --- a/core/src/components/modal/test/spec/index.html +++ b/core/src/components/modal/test/spec/index.html @@ -6,18 +6,13 @@