@ionic/core 8.7.16-dev.11767019759.14b7f2fa → 8.7.16-dev.11767028735.16932cea

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -246,7 +246,7 @@ const calculateSpringStep = (t) => {
246
246
  const SwipeToCloseDefaults = {
247
247
  MIN_PRESENTING_SCALE: 0.915,
248
248
  };
249
- const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss, onGestureMove) => {
249
+ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) => {
250
250
  /**
251
251
  * The step value at which a card modal
252
252
  * is eligible for dismissing via gesture.
@@ -403,8 +403,6 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss, onG
403
403
  const processedStep = isAttemptingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;
404
404
  const clampedStep = clamp(0.0001, processedStep, maxStep);
405
405
  animation.progressStep(clampedStep);
406
- // Notify modal of position change for safe-area updates
407
- onGestureMove === null || onGestureMove === void 0 ? void 0 : onGestureMove();
408
406
  /**
409
407
  * When swiping down half way, the status bar style
410
408
  * should be reset to its default value.
@@ -948,7 +946,7 @@ const mdLeaveAnimation = (baseEl, opts) => {
948
946
  return baseAnimation;
949
947
  };
950
948
 
951
- const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, onGestureMove) => {
949
+ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
952
950
  // Defaults for the sheet swipe animation
953
951
  const defaultBackdrop = [
954
952
  { offset: 0, opacity: 'var(--backdrop-opacity)' },
@@ -1279,8 +1277,6 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
1279
1277
  : step;
1280
1278
  offset = clamp(0.0001, processedStep, maxStep);
1281
1279
  animation.progressStep(offset);
1282
- // Notify modal of position change for safe-area updates
1283
- onGestureMove === null || onGestureMove === void 0 ? void 0 : onGestureMove();
1284
1280
  };
1285
1281
  const onEnd = (detail) => {
1286
1282
  /**
@@ -1475,9 +1471,9 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
1475
1471
  };
1476
1472
  };
1477
1473
 
1478
- const modalIosCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\"\"}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}";
1474
+ const modalIosCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\"\"}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}";
1479
1475
 
1480
- const modalMdCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\"\"}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}";
1476
+ const modalMdCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\"\"}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}";
1481
1477
 
1482
1478
  const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1483
1479
  constructor(registerHost) {
@@ -1694,9 +1690,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1694
1690
  }
1695
1691
  }
1696
1692
  onWindowResize() {
1697
- // Update safe-area overrides for all modal types on resize
1698
- this.updateSafeAreaOverrides();
1699
- // Only handle view transition for iOS card modals when no custom animations are provided
1693
+ // Only handle resize for iOS card modals when no custom animations are provided
1700
1694
  if (getIonMode(this) !== 'ios' || !this.presentingElement || this.enterAnimation || this.leaveAnimation) {
1701
1695
  return;
1702
1696
  }
@@ -1878,8 +1872,6 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1878
1872
  else if (!this.keepContentsMounted) {
1879
1873
  await waitForMount();
1880
1874
  }
1881
- // Predict safe-area needs based on modal configuration to avoid visual snap
1882
- this.setInitialSafeAreaOverrides(presentingElement);
1883
1875
  writeTask(() => this.el.classList.add('show-modal'));
1884
1876
  const hasCardModal = presentingElement !== undefined;
1885
1877
  /**
@@ -1941,8 +1933,6 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1941
1933
  else if (hasCardModal) {
1942
1934
  this.initSwipeToClose();
1943
1935
  }
1944
- // Now that animation is complete, update safe-area based on actual position
1945
- this.updateSafeAreaOverrides();
1946
1936
  // Initialize view transition listener for iOS card modals
1947
1937
  this.initViewTransitionListener();
1948
1938
  // Initialize parent removal observer
@@ -1994,7 +1984,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
1994
1984
  await this.dismiss(undefined, GESTURE);
1995
1985
  this.gestureAnimationDismissing = false;
1996
1986
  });
1997
- }, () => this.updateSafeAreaOverrides());
1987
+ });
1998
1988
  this.gesture.enable(true);
1999
1989
  }
2000
1990
  initSheetGesture() {
@@ -2015,8 +2005,7 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
2015
2005
  this.currentBreakpoint = breakpoint;
2016
2006
  this.ionBreakpointDidChange.emit({ breakpoint });
2017
2007
  }
2018
- this.updateSafeAreaOverrides();
2019
- }, () => this.updateSafeAreaOverrides());
2008
+ });
2020
2009
  this.gesture = gesture;
2021
2010
  this.moveSheetToBreakpoint = moveSheetToBreakpoint;
2022
2011
  this.gesture.enable(true);
@@ -2094,76 +2083,6 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
2094
2083
  // Clear the cached reference
2095
2084
  this.cachedPageParent = undefined;
2096
2085
  }
2097
- /**
2098
- * Sets initial safe-area overrides based on modal configuration before
2099
- * the modal becomes visible. This predicts whether the modal will touch
2100
- * screen edges to avoid a visual snap after animation completes.
2101
- */
2102
- setInitialSafeAreaOverrides(presentingElement) {
2103
- const style = this.el.style;
2104
- const isSheetModal = this.breakpoints !== undefined && this.initialBreakpoint !== undefined;
2105
- const isCardModal = presentingElement !== undefined;
2106
- const isTablet = window.innerWidth >= 768;
2107
- // Sheet modals: always touch bottom, top depends on breakpoint
2108
- if (isSheetModal) {
2109
- style.setProperty('--ion-safe-area-top', '0px');
2110
- // Don't override bottom - sheet always touches bottom
2111
- style.setProperty('--ion-safe-area-left', '0px');
2112
- style.setProperty('--ion-safe-area-right', '0px');
2113
- return;
2114
- }
2115
- // Card modals are inset from edges (rounded corners), no safe areas needed
2116
- if (isCardModal) {
2117
- style.setProperty('--ion-safe-area-top', '0px');
2118
- style.setProperty('--ion-safe-area-bottom', '0px');
2119
- style.setProperty('--ion-safe-area-left', '0px');
2120
- style.setProperty('--ion-safe-area-right', '0px');
2121
- return;
2122
- }
2123
- // Phone modals are fullscreen, need all safe areas
2124
- if (!isTablet) {
2125
- // Don't set any overrides - inherit from :root
2126
- return;
2127
- }
2128
- // Default tablet modal: centered dialog, no safe areas needed
2129
- // Check for fullscreen override via CSS custom properties
2130
- const computedStyle = getComputedStyle(this.el);
2131
- const width = computedStyle.getPropertyValue('--width').trim();
2132
- const height = computedStyle.getPropertyValue('--height').trim();
2133
- if (width === '100%' && height === '100%') {
2134
- // Fullscreen modal - need safe areas, don't override
2135
- return;
2136
- }
2137
- // Centered dialog - zero out all safe areas
2138
- style.setProperty('--ion-safe-area-top', '0px');
2139
- style.setProperty('--ion-safe-area-bottom', '0px');
2140
- style.setProperty('--ion-safe-area-left', '0px');
2141
- style.setProperty('--ion-safe-area-right', '0px');
2142
- }
2143
- /**
2144
- * Updates safe-area CSS variable overrides based on whether the modal
2145
- * is touching each edge of the viewport. This is called after animation
2146
- * and during gestures to handle dynamic position changes.
2147
- */
2148
- updateSafeAreaOverrides() {
2149
- const wrapper = this.wrapperEl;
2150
- if (!wrapper)
2151
- return;
2152
- const rect = wrapper.getBoundingClientRect();
2153
- const threshold = 2; // Account for subpixel rendering
2154
- const touchingTop = rect.top <= threshold;
2155
- const touchingBottom = rect.bottom >= window.innerHeight - threshold;
2156
- const touchingLeft = rect.left <= threshold;
2157
- const touchingRight = rect.right >= window.innerWidth - threshold;
2158
- // Remove override when touching edge (allow inheritance), set to 0 when not touching
2159
- const style = this.el.style;
2160
- touchingTop ? style.removeProperty('--ion-safe-area-top') : style.setProperty('--ion-safe-area-top', '0px');
2161
- touchingBottom
2162
- ? style.removeProperty('--ion-safe-area-bottom')
2163
- : style.setProperty('--ion-safe-area-bottom', '0px');
2164
- touchingLeft ? style.removeProperty('--ion-safe-area-left') : style.setProperty('--ion-safe-area-left', '0px');
2165
- touchingRight ? style.removeProperty('--ion-safe-area-right') : style.setProperty('--ion-safe-area-right', '0px');
2166
- }
2167
2086
  sheetOnDismiss() {
2168
2087
  /**
2169
2088
  * While the gesture animation is finishing
@@ -2337,6 +2256,10 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
2337
2256
  this.currentViewIsPortrait = window.innerWidth < 768;
2338
2257
  }
2339
2258
  handleViewTransition() {
2259
+ // Only run view transitions when the modal is presented
2260
+ if (!this.presented) {
2261
+ return;
2262
+ }
2340
2263
  const isPortrait = window.innerWidth < 768;
2341
2264
  // Only transition if view state actually changed
2342
2265
  if (this.currentViewIsPortrait === isPortrait) {
@@ -2501,20 +2424,20 @@ const Modal = /*@__PURE__*/ proxyCustomElement(class Modal extends HTMLElement {
2501
2424
  const isCardModal = presentingElement !== undefined && mode === 'ios';
2502
2425
  const isHandleCycle = handleBehavior === 'cycle';
2503
2426
  const isSheetModalWithHandle = isSheetModal && showHandle;
2504
- return (h(Host, Object.assign({ key: 'e80cac8f52f1056eaf63112eafcfdcd029aa31e8', "no-router": true,
2427
+ return (h(Host, Object.assign({ key: '87328006ea6c75ebc518ace300438492a567223e', "no-router": true,
2505
2428
  // Allow the modal to be navigable when the handle is focusable
2506
2429
  tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
2507
2430
  zIndex: `${20000 + this.overlayIndex}`,
2508
- }, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), h("ion-backdrop", { key: 'dcc24085006dd1e41c47a55031d78bd55ddeb622', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { key: '74c4ff6bdc87f8c29ee8ba0592c97db2c597d876', class: "modal-shadow" }), h("div", Object.assign({ key: '79f3b01bdadc0d830e5707026aa2055d62714274',
2431
+ }, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), h("ion-backdrop", { key: 'ee94ff8e09b691dd4ad4e4db1720f06bc3c5a469', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { key: 'bffd69b4635c22d9f249725bd952c1e93d5615c7', class: "modal-shadow" }), h("div", Object.assign({ key: '1d394d3c68916e464ff1fbf5242419f4a3d3cca1',
2509
2432
  /*
2510
2433
  role and aria-modal must be used on the
2511
2434
  same element. They must also be set inside the
2512
2435
  shadow DOM otherwise ion-button will not be highlighted
2513
2436
  when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
2514
2437
  */
2515
- role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: 'b250920bad86e23269f900353d531975a95662af', class: "modal-handle",
2438
+ role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: '2dcf58792018e557e0c323baad2d672bc99c0bb1', class: "modal-handle",
2516
2439
  // Prevents the handle from receiving keyboard focus when it does not cycle
2517
- tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), h("slot", { key: '2ba83c0f0a92784cac127c6581f12ea06b201b97', onSlotchange: this.onSlotChange }))));
2440
+ tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), h("slot", { key: '44164b1e8710c3895400ad9f44ecd99873874ad5', onSlotchange: this.onSlotChange }))));
2518
2441
  }
2519
2442
  get el() { return this; }
2520
2443
  static get watchers() { return {
@@ -249,7 +249,7 @@ const calculateSpringStep = (t) => {
249
249
  const SwipeToCloseDefaults = {
250
250
  MIN_PRESENTING_SCALE: 0.915,
251
251
  };
252
- const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss, onGestureMove) => {
252
+ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) => {
253
253
  /**
254
254
  * The step value at which a card modal
255
255
  * is eligible for dismissing via gesture.
@@ -406,8 +406,6 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss, onG
406
406
  const processedStep = isAttemptingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;
407
407
  const clampedStep = helpers.clamp(0.0001, processedStep, maxStep);
408
408
  animation.progressStep(clampedStep);
409
- // Notify modal of position change for safe-area updates
410
- onGestureMove === null || onGestureMove === void 0 ? void 0 : onGestureMove();
411
409
  /**
412
410
  * When swiping down half way, the status bar style
413
411
  * should be reset to its default value.
@@ -951,7 +949,7 @@ const mdLeaveAnimation = (baseEl, opts) => {
951
949
  return baseAnimation;
952
950
  };
953
951
 
954
- const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, onGestureMove) => {
952
+ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
955
953
  // Defaults for the sheet swipe animation
956
954
  const defaultBackdrop = [
957
955
  { offset: 0, opacity: 'var(--backdrop-opacity)' },
@@ -1282,8 +1280,6 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
1282
1280
  : step;
1283
1281
  offset = helpers.clamp(0.0001, processedStep, maxStep);
1284
1282
  animation.progressStep(offset);
1285
- // Notify modal of position change for safe-area updates
1286
- onGestureMove === null || onGestureMove === void 0 ? void 0 : onGestureMove();
1287
1283
  };
1288
1284
  const onEnd = (detail) => {
1289
1285
  /**
@@ -1478,9 +1474,9 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
1478
1474
  };
1479
1475
  };
1480
1476
 
1481
- const modalIosCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\"\"}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}";
1477
+ const modalIosCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\"\"}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-start-start-radius:var(--border-radius);border-start-end-radius:var(--border-radius);border-end-end-radius:0;border-end-start-radius:0}";
1482
1478
 
1483
- const modalMdCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\"\"}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}";
1479
+ const modalMdCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, var(--ion-background-color-step-350, #c0c0be));cursor:pointer;z-index:11}.modal-handle::before{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\"\"}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host(.modal-sheet.modal-no-expand-scroll) ion-footer{position:absolute;bottom:0;width:var(--width)}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}";
1484
1480
 
1485
1481
  const Modal = class {
1486
1482
  constructor(hostRef) {
@@ -1693,9 +1689,7 @@ const Modal = class {
1693
1689
  }
1694
1690
  }
1695
1691
  onWindowResize() {
1696
- // Update safe-area overrides for all modal types on resize
1697
- this.updateSafeAreaOverrides();
1698
- // Only handle view transition for iOS card modals when no custom animations are provided
1692
+ // Only handle resize for iOS card modals when no custom animations are provided
1699
1693
  if (ionicGlobal.getIonMode(this) !== 'ios' || !this.presentingElement || this.enterAnimation || this.leaveAnimation) {
1700
1694
  return;
1701
1695
  }
@@ -1877,8 +1871,6 @@ const Modal = class {
1877
1871
  else if (!this.keepContentsMounted) {
1878
1872
  await index$4.waitForMount();
1879
1873
  }
1880
- // Predict safe-area needs based on modal configuration to avoid visual snap
1881
- this.setInitialSafeAreaOverrides(presentingElement);
1882
1874
  index$3.writeTask(() => this.el.classList.add('show-modal'));
1883
1875
  const hasCardModal = presentingElement !== undefined;
1884
1876
  /**
@@ -1940,8 +1932,6 @@ const Modal = class {
1940
1932
  else if (hasCardModal) {
1941
1933
  this.initSwipeToClose();
1942
1934
  }
1943
- // Now that animation is complete, update safe-area based on actual position
1944
- this.updateSafeAreaOverrides();
1945
1935
  // Initialize view transition listener for iOS card modals
1946
1936
  this.initViewTransitionListener();
1947
1937
  // Initialize parent removal observer
@@ -1993,7 +1983,7 @@ const Modal = class {
1993
1983
  await this.dismiss(undefined, overlays.GESTURE);
1994
1984
  this.gestureAnimationDismissing = false;
1995
1985
  });
1996
- }, () => this.updateSafeAreaOverrides());
1986
+ });
1997
1987
  this.gesture.enable(true);
1998
1988
  }
1999
1989
  initSheetGesture() {
@@ -2014,8 +2004,7 @@ const Modal = class {
2014
2004
  this.currentBreakpoint = breakpoint;
2015
2005
  this.ionBreakpointDidChange.emit({ breakpoint });
2016
2006
  }
2017
- this.updateSafeAreaOverrides();
2018
- }, () => this.updateSafeAreaOverrides());
2007
+ });
2019
2008
  this.gesture = gesture;
2020
2009
  this.moveSheetToBreakpoint = moveSheetToBreakpoint;
2021
2010
  this.gesture.enable(true);
@@ -2093,76 +2082,6 @@ const Modal = class {
2093
2082
  // Clear the cached reference
2094
2083
  this.cachedPageParent = undefined;
2095
2084
  }
2096
- /**
2097
- * Sets initial safe-area overrides based on modal configuration before
2098
- * the modal becomes visible. This predicts whether the modal will touch
2099
- * screen edges to avoid a visual snap after animation completes.
2100
- */
2101
- setInitialSafeAreaOverrides(presentingElement) {
2102
- const style = this.el.style;
2103
- const isSheetModal = this.breakpoints !== undefined && this.initialBreakpoint !== undefined;
2104
- const isCardModal = presentingElement !== undefined;
2105
- const isTablet = window.innerWidth >= 768;
2106
- // Sheet modals: always touch bottom, top depends on breakpoint
2107
- if (isSheetModal) {
2108
- style.setProperty('--ion-safe-area-top', '0px');
2109
- // Don't override bottom - sheet always touches bottom
2110
- style.setProperty('--ion-safe-area-left', '0px');
2111
- style.setProperty('--ion-safe-area-right', '0px');
2112
- return;
2113
- }
2114
- // Card modals are inset from edges (rounded corners), no safe areas needed
2115
- if (isCardModal) {
2116
- style.setProperty('--ion-safe-area-top', '0px');
2117
- style.setProperty('--ion-safe-area-bottom', '0px');
2118
- style.setProperty('--ion-safe-area-left', '0px');
2119
- style.setProperty('--ion-safe-area-right', '0px');
2120
- return;
2121
- }
2122
- // Phone modals are fullscreen, need all safe areas
2123
- if (!isTablet) {
2124
- // Don't set any overrides - inherit from :root
2125
- return;
2126
- }
2127
- // Default tablet modal: centered dialog, no safe areas needed
2128
- // Check for fullscreen override via CSS custom properties
2129
- const computedStyle = getComputedStyle(this.el);
2130
- const width = computedStyle.getPropertyValue('--width').trim();
2131
- const height = computedStyle.getPropertyValue('--height').trim();
2132
- if (width === '100%' && height === '100%') {
2133
- // Fullscreen modal - need safe areas, don't override
2134
- return;
2135
- }
2136
- // Centered dialog - zero out all safe areas
2137
- style.setProperty('--ion-safe-area-top', '0px');
2138
- style.setProperty('--ion-safe-area-bottom', '0px');
2139
- style.setProperty('--ion-safe-area-left', '0px');
2140
- style.setProperty('--ion-safe-area-right', '0px');
2141
- }
2142
- /**
2143
- * Updates safe-area CSS variable overrides based on whether the modal
2144
- * is touching each edge of the viewport. This is called after animation
2145
- * and during gestures to handle dynamic position changes.
2146
- */
2147
- updateSafeAreaOverrides() {
2148
- const wrapper = this.wrapperEl;
2149
- if (!wrapper)
2150
- return;
2151
- const rect = wrapper.getBoundingClientRect();
2152
- const threshold = 2; // Account for subpixel rendering
2153
- const touchingTop = rect.top <= threshold;
2154
- const touchingBottom = rect.bottom >= window.innerHeight - threshold;
2155
- const touchingLeft = rect.left <= threshold;
2156
- const touchingRight = rect.right >= window.innerWidth - threshold;
2157
- // Remove override when touching edge (allow inheritance), set to 0 when not touching
2158
- const style = this.el.style;
2159
- touchingTop ? style.removeProperty('--ion-safe-area-top') : style.setProperty('--ion-safe-area-top', '0px');
2160
- touchingBottom
2161
- ? style.removeProperty('--ion-safe-area-bottom')
2162
- : style.setProperty('--ion-safe-area-bottom', '0px');
2163
- touchingLeft ? style.removeProperty('--ion-safe-area-left') : style.setProperty('--ion-safe-area-left', '0px');
2164
- touchingRight ? style.removeProperty('--ion-safe-area-right') : style.setProperty('--ion-safe-area-right', '0px');
2165
- }
2166
2085
  sheetOnDismiss() {
2167
2086
  /**
2168
2087
  * While the gesture animation is finishing
@@ -2336,6 +2255,10 @@ const Modal = class {
2336
2255
  this.currentViewIsPortrait = window.innerWidth < 768;
2337
2256
  }
2338
2257
  handleViewTransition() {
2258
+ // Only run view transitions when the modal is presented
2259
+ if (!this.presented) {
2260
+ return;
2261
+ }
2339
2262
  const isPortrait = window.innerWidth < 768;
2340
2263
  // Only transition if view state actually changed
2341
2264
  if (this.currentViewIsPortrait === isPortrait) {
@@ -2500,20 +2423,20 @@ const Modal = class {
2500
2423
  const isCardModal = presentingElement !== undefined && mode === 'ios';
2501
2424
  const isHandleCycle = handleBehavior === 'cycle';
2502
2425
  const isSheetModalWithHandle = isSheetModal && showHandle;
2503
- return (index$3.h(index$3.Host, Object.assign({ key: 'e80cac8f52f1056eaf63112eafcfdcd029aa31e8', "no-router": true,
2426
+ return (index$3.h(index$3.Host, Object.assign({ key: '87328006ea6c75ebc518ace300438492a567223e', "no-router": true,
2504
2427
  // Allow the modal to be navigable when the handle is focusable
2505
2428
  tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
2506
2429
  zIndex: `${20000 + this.overlayIndex}`,
2507
- }, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [overlays.FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), index$3.h("ion-backdrop", { key: 'dcc24085006dd1e41c47a55031d78bd55ddeb622', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && index$3.h("div", { key: '74c4ff6bdc87f8c29ee8ba0592c97db2c597d876', class: "modal-shadow" }), index$3.h("div", Object.assign({ key: '79f3b01bdadc0d830e5707026aa2055d62714274',
2430
+ }, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [overlays.FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), index$3.h("ion-backdrop", { key: 'ee94ff8e09b691dd4ad4e4db1720f06bc3c5a469', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && index$3.h("div", { key: 'bffd69b4635c22d9f249725bd952c1e93d5615c7', class: "modal-shadow" }), index$3.h("div", Object.assign({ key: '1d394d3c68916e464ff1fbf5242419f4a3d3cca1',
2508
2431
  /*
2509
2432
  role and aria-modal must be used on the
2510
2433
  same element. They must also be set inside the
2511
2434
  shadow DOM otherwise ion-button will not be highlighted
2512
2435
  when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
2513
2436
  */
2514
- role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (index$3.h("button", { key: 'b250920bad86e23269f900353d531975a95662af', class: "modal-handle",
2437
+ role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (index$3.h("button", { key: '2dcf58792018e557e0c323baad2d672bc99c0bb1', class: "modal-handle",
2515
2438
  // Prevents the handle from receiving keyboard focus when it does not cycle
2516
- tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), index$3.h("slot", { key: '2ba83c0f0a92784cac127c6581f12ea06b201b97', onSlotchange: this.onSlotChange }))));
2439
+ tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), index$3.h("slot", { key: '44164b1e8710c3895400ad9f44ecd99873874ad5', onSlotchange: this.onSlotChange }))));
2517
2440
  }
2518
2441
  get el() { return index$3.getElement(this); }
2519
2442
  static get watchers() { return {
@@ -7,7 +7,7 @@ import { clamp, getElementRoot, raf } from "../../../utils/helpers";
7
7
  import { FOCUS_TRAP_DISABLE_CLASS } from "../../../utils/overlays";
8
8
  import { getBackdropValueForSheet } from "../utils";
9
9
  import { calculateSpringStep, handleCanDismiss } from "./utils";
10
- export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, onGestureMove) => {
10
+ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
11
11
  // Defaults for the sheet swipe animation
12
12
  const defaultBackdrop = [
13
13
  { offset: 0, opacity: 'var(--backdrop-opacity)' },
@@ -338,8 +338,6 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
338
338
  : step;
339
339
  offset = clamp(0.0001, processedStep, maxStep);
340
340
  animation.progressStep(offset);
341
- // Notify modal of position change for safe-area updates
342
- onGestureMove === null || onGestureMove === void 0 ? void 0 : onGestureMove();
343
341
  };
344
342
  const onEnd = (detail) => {
345
343
  /**
@@ -12,7 +12,7 @@ import { calculateSpringStep, handleCanDismiss } from "./utils";
12
12
  export const SwipeToCloseDefaults = {
13
13
  MIN_PRESENTING_SCALE: 0.915,
14
14
  };
15
- export const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss, onGestureMove) => {
15
+ export const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) => {
16
16
  /**
17
17
  * The step value at which a card modal
18
18
  * is eligible for dismissing via gesture.
@@ -169,8 +169,6 @@ export const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismi
169
169
  const processedStep = isAttemptingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;
170
170
  const clampedStep = clamp(0.0001, processedStep, maxStep);
171
171
  animation.progressStep(clampedStep);
172
- // Notify modal of position change for safe-area updates
173
- onGestureMove === null || onGestureMove === void 0 ? void 0 : onGestureMove();
174
172
  /**
175
173
  * When swiping down half way, the status bar style
176
174
  * should be reset to its default value.
@@ -135,6 +135,10 @@ ion-backdrop {
135
135
  :host {
136
136
  --width: 600px;
137
137
  --height: 500px;
138
+ --ion-safe-area-top: 0px;
139
+ --ion-safe-area-bottom: 0px;
140
+ --ion-safe-area-right: 0px;
141
+ --ion-safe-area-left: 0px;
138
142
  }
139
143
  }
140
144
  @media only screen and (min-width: 768px) and (min-height: 768px) {