diff --git a/core/src/components/popover/animations/ios.enter.ts b/core/src/components/popover/animations/ios.enter.ts index e1e8123788..6e8399a2a9 100644 --- a/core/src/components/popover/animations/ios.enter.ts +++ b/core/src/components/popover/animations/ios.enter.ts @@ -54,16 +54,7 @@ export const iosEnterAnimation = (baseEl: HTMLElement, opts?: any): Animation => const padding = size === 'cover' ? 0 : POPOVER_IOS_BODY_PADDING; - const { - originX, - originY, - top, - left, - bottom, - arrowTop, - arrowLeft, - addPopoverBottomClass, - } = calculateWindowAdjustment( + const { originX, originY, top, left, bottom, arrowTop, arrowLeft, addPopoverBottomClass } = calculateWindowAdjustment( side, results.top, results.left, diff --git a/core/src/components/popover/utils.ts b/core/src/components/popover/utils.ts index 01e78a1973..70cffd8c60 100644 --- a/core/src/components/popover/utils.ts +++ b/core/src/components/popover/utils.ts @@ -850,7 +850,7 @@ export const calculateWindowAdjustment = ( */ let horizontalSafeAreaApprox = 0; let verticalSafeAreaApprox = 0; - if (win !== undefined && win.matchMedia !== undefined) { + if (win?.matchMedia !== undefined) { verticalSafeAreaApprox = win.innerHeight * 0.05; /** @@ -899,7 +899,10 @@ export const calculateWindowAdjustment = ( * the trigger, then we should not adjust top * margins. */ - if (triggerTop + triggerHeight + contentHeight + verticalSafeAreaApprox > bodyHeight && (side === 'top' || side === 'bottom')) { + if ( + triggerTop + triggerHeight + contentHeight + verticalSafeAreaApprox > bodyHeight && + (side === 'top' || side === 'bottom') + ) { if (triggerTop - contentHeight > 0) { /** * While we strive to align the popover with the trigger