mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 15:51:16 +08:00
@ -31,7 +31,13 @@ export const iosEnterAnimation = (
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
|
||||
if (presentingEl) {
|
||||
const modalTransform = (presentingEl.tagName === 'ION-MODAL' && (presentingEl as HTMLIonModalElement).presentingElement !== undefined) ? '-10px' : 'max(30px, var(--ion-safe-area-top))';
|
||||
/**
|
||||
* Fallback for browsers that does not support `max()` (ex: Firefox)
|
||||
* No need to wrry about statusbar padding since engines like Gecko
|
||||
* are not used as the engine for standlone Cordova/Capacitor apps
|
||||
*/
|
||||
const transformOffset = (!CSS.supports('width', 'max(0px, 1px)')) ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
||||
const modalTransform = (presentingEl.tagName === 'ION-MODAL' && (presentingEl as HTMLIonModalElement).presentingElement !== undefined) ? '-10px' : transformOffset;
|
||||
const bodyEl = document.body;
|
||||
const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
||||
const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;
|
||||
|
||||
@ -27,7 +27,8 @@ export const iosLeaveAnimation = (
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
|
||||
if (presentingEl) {
|
||||
const modalTransform = (presentingEl.tagName === 'ION-MODAL' && (presentingEl as HTMLIonModalElement).presentingElement !== undefined) ? '-10px' : 'max(30px, var(--ion-safe-area-top))';
|
||||
const transformOffset = (!CSS.supports('width', 'max(0px, 1px)')) ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
||||
const modalTransform = (presentingEl.tagName === 'ION-MODAL' && (presentingEl as HTMLIonModalElement).presentingElement !== undefined) ? '-10px' : transformOffset;
|
||||
const bodyEl = document.body;
|
||||
const currentPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
||||
const presentingAnimation = createAnimation()
|
||||
|
||||
@ -28,5 +28,11 @@
|
||||
|
||||
:host(.modal-card) .modal-wrapper {
|
||||
@include border-radius($modal-ios-border-radius, $modal-ios-border-radius, 0, 0);
|
||||
height: calc(100% - 40px);
|
||||
}
|
||||
|
||||
@supports (width: max(0px, 1px)) {
|
||||
:host(.modal-card) .modal-wrapper {
|
||||
height: calc(100% - max(30px, var(--ion-safe-area-top)) - 10px);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user