@ionic/core 8.3.4-dev.11729879684.1ea28919 → 8.3.4-dev.11729882231.1b2e7f13

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.
Files changed (77) hide show
  1. package/components/action-sheet.js +2 -2
  2. package/components/alert.js +1 -1
  3. package/components/ion-loading.js +1 -1
  4. package/components/ion-picker-legacy.js +1 -1
  5. package/components/overlays.js +41 -28
  6. package/dist/cjs/index.cjs.js +1 -1
  7. package/dist/cjs/ion-action-sheet.cjs.entry.js +3 -3
  8. package/dist/cjs/ion-alert.cjs.entry.js +2 -2
  9. package/dist/cjs/ion-datetime_3.cjs.entry.js +2 -2
  10. package/dist/cjs/ion-loading.cjs.entry.js +2 -2
  11. package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
  12. package/dist/cjs/ion-modal.cjs.entry.js +1 -1
  13. package/dist/cjs/ion-popover.cjs.entry.js +1 -1
  14. package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
  15. package/dist/cjs/ion-toast.cjs.entry.js +1 -1
  16. package/dist/cjs/{overlays-ec7d9b5a.js → overlays-99f0578e.js} +41 -28
  17. package/dist/collection/components/action-sheet/action-sheet.js +2 -2
  18. package/dist/collection/components/alert/alert.js +1 -1
  19. package/dist/collection/components/loading/loading.js +1 -1
  20. package/dist/collection/components/picker-legacy/picker.js +1 -1
  21. package/dist/collection/utils/overlays.js +41 -28
  22. package/dist/docs.json +1 -1
  23. package/dist/esm/index.js +1 -1
  24. package/dist/esm/ion-action-sheet.entry.js +3 -3
  25. package/dist/esm/ion-alert.entry.js +2 -2
  26. package/dist/esm/ion-datetime_3.entry.js +2 -2
  27. package/dist/esm/ion-loading.entry.js +2 -2
  28. package/dist/esm/ion-menu_3.entry.js +1 -1
  29. package/dist/esm/ion-modal.entry.js +1 -1
  30. package/dist/esm/ion-popover.entry.js +1 -1
  31. package/dist/esm/ion-select_3.entry.js +1 -1
  32. package/dist/esm/ion-toast.entry.js +1 -1
  33. package/dist/esm/{overlays-d7b67e94.js → overlays-d597fdaf.js} +41 -28
  34. package/dist/esm-es5/index.js +1 -1
  35. package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
  36. package/dist/esm-es5/ion-alert.entry.js +1 -1
  37. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  38. package/dist/esm-es5/ion-loading.entry.js +1 -1
  39. package/dist/esm-es5/ion-menu_3.entry.js +1 -1
  40. package/dist/esm-es5/ion-modal.entry.js +1 -1
  41. package/dist/esm-es5/ion-popover.entry.js +1 -1
  42. package/dist/esm-es5/ion-select_3.entry.js +1 -1
  43. package/dist/esm-es5/ion-toast.entry.js +1 -1
  44. package/dist/esm-es5/overlays-d597fdaf.js +4 -0
  45. package/dist/ionic/index.esm.js +1 -1
  46. package/dist/ionic/ionic.esm.js +1 -1
  47. package/dist/ionic/{p-26e35c79.system.js → p-038ea840.system.js} +1 -1
  48. package/dist/ionic/p-21708c6d.entry.js +4 -0
  49. package/dist/ionic/{p-c43aa331.entry.js → p-2e7be929.entry.js} +1 -1
  50. package/dist/ionic/p-322c5fb4.system.js +1 -1
  51. package/dist/ionic/{p-92595957.system.entry.js → p-3f2d6260.system.entry.js} +1 -1
  52. package/dist/ionic/{p-fc77485b.entry.js → p-41bce8cd.entry.js} +1 -1
  53. package/dist/ionic/{p-9cb7129c.system.entry.js → p-49c0907c.system.entry.js} +2 -2
  54. package/dist/ionic/p-61c3ffe5.system.js +4 -0
  55. package/dist/ionic/{p-e36b14f9.system.entry.js → p-69545f3a.system.entry.js} +1 -1
  56. package/dist/ionic/{p-a7f82b4e.system.entry.js → p-7ba39d00.system.entry.js} +1 -1
  57. package/dist/ionic/p-7d1ef246.js +4 -0
  58. package/dist/ionic/{p-2b7838a8.entry.js → p-a8a06b1a.entry.js} +1 -1
  59. package/dist/ionic/p-afa2b222.entry.js +4 -0
  60. package/dist/ionic/{p-e75a4b67.system.entry.js → p-b3b53a16.system.entry.js} +1 -1
  61. package/dist/ionic/{p-d3fc49aa.system.entry.js → p-c7283303.system.entry.js} +1 -1
  62. package/dist/ionic/p-ccd7a8fe.entry.js +4 -0
  63. package/dist/ionic/{p-a60604de.system.entry.js → p-cdbced33.system.entry.js} +1 -1
  64. package/dist/ionic/{p-34343a73.system.entry.js → p-df4085d5.system.entry.js} +1 -1
  65. package/dist/ionic/{p-4f3d2686.entry.js → p-dfac744b.entry.js} +1 -1
  66. package/dist/ionic/{p-6bc7a4a9.entry.js → p-efce3337.entry.js} +1 -1
  67. package/dist/ionic/{p-fadf58d8.entry.js → p-f01b6d5d.entry.js} +1 -1
  68. package/dist/ionic/{p-8acd6d79.system.entry.js → p-f216e5b6.system.entry.js} +1 -1
  69. package/hydrate/index.js +46 -33
  70. package/hydrate/index.mjs +46 -33
  71. package/package.json +1 -1
  72. package/dist/esm-es5/overlays-d7b67e94.js +0 -4
  73. package/dist/ionic/p-13542e1b.entry.js +0 -4
  74. package/dist/ionic/p-8d86e104.js +0 -4
  75. package/dist/ionic/p-a5e9e45f.entry.js +0 -4
  76. package/dist/ionic/p-c3be1039.entry.js +0 -4
  77. package/dist/ionic/p-e61ed046.system.js +0 -4
@@ -294,10 +294,10 @@ const ActionSheet = /*@__PURE__*/ proxyCustomElement(class ActionSheet extends H
294
294
  const headerID = `action-sheet-${overlayIndex}-header`;
295
295
  return (h(Host, Object.assign({ key: '7bbd202ca9e19727e7514abbe073687d982f80c3', role: "dialog", "aria-modal": "true", "aria-labelledby": header !== undefined ? headerID : null, tabindex: "-1" }, htmlAttributes, { style: {
296
296
  zIndex: `${20000 + this.overlayIndex}`,
297
- }, class: Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { key: '23344a9221a2e6720d7b9de5249dc37256cafa7b', tappable: this.backdropDismiss }), h("div", { key: 'd46361bb5cdc32a7922dcf76b566f358a6174bfa', tabindex: "0" }), h("div", { key: '136c3f2e77c8a2eac8e9ae4bb13d735e1d62598d', class: "action-sheet-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, h("div", { key: '6168ea8b2be42020b2edeb8ff3a0f3d1254be37a', class: "action-sheet-container" }, h("div", { key: '29b9e6619dc54574733a704d6bf885839151bd84', class: "action-sheet-group", ref: (el) => (this.groupEl = el) }, header !== undefined && (h("div", { key: '536ce764bfddb3816ea3512d90f4acef2ccb8589', id: headerID, class: {
297
+ }, class: Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { key: '23344a9221a2e6720d7b9de5249dc37256cafa7b', tappable: this.backdropDismiss }), h("div", { key: 'fbc2ba15549c2ab04e759e82df6e177fd80cc0a6', tabindex: "0", "aria-hidden": "true" }), h("div", { key: '748ee5235d0b4cb26d6f1b7589f77af2e37ad28a', class: "action-sheet-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, h("div", { key: '7ce5fa236cf75e9b1e49c4725c9a811078706554', class: "action-sheet-container" }, h("div", { key: 'dc2251f3bcee4a93e3449f09621cbd2b65d329e9', class: "action-sheet-group", ref: (el) => (this.groupEl = el) }, header !== undefined && (h("div", { key: '48d325c8a852f56ed57a9ada1a6709d05ba32ee2', id: headerID, class: {
298
298
  'action-sheet-title': true,
299
299
  'action-sheet-has-sub-title': this.subHeader !== undefined,
300
- } }, header, this.subHeader && h("div", { key: '6d888219145824fd36cdfe0d3c8388bbf2769777', class: "action-sheet-sub-title" }, this.subHeader))), buttons.map((b) => (h("button", Object.assign({}, b.htmlAttributes, { type: "button", id: b.id, class: buttonClass(b), onClick: () => this.buttonClick(b), disabled: b.disabled }), h("span", { class: "action-sheet-button-inner" }, b.icon && h("ion-icon", { icon: b.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" }), b.text), mode === 'md' && h("ion-ripple-effect", null))))), cancelButton && (h("div", { key: '46f98f0ed5a9bdb3e35feb9ae71c4489c17b7d77', class: "action-sheet-group action-sheet-group-cancel" }, h("button", Object.assign({ key: 'e3c457bced8ad5f692e48de26e65f731fd631b4f' }, cancelButton.htmlAttributes, { type: "button", class: buttonClass(cancelButton), onClick: () => this.buttonClick(cancelButton) }), h("span", { key: '4cba6dc559f734ecc852e024959210cd0dd25354', class: "action-sheet-button-inner" }, cancelButton.icon && (h("ion-icon", { key: '9df64989aad1b4d1e75edf4d37ab208965cfe37f', icon: cancelButton.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" })), cancelButton.text), mode === 'md' && h("ion-ripple-effect", { key: '558089275a29177cefdb2e38eefc9b5c8b62872b' })))))), h("div", { key: 'fa4df6e043b00a6e4126dbc71cb344cfc2b2e7bc', tabindex: "0" })));
300
+ } }, header, this.subHeader && h("div", { key: '66093728052eb67f37a35f3232761ce4a08896f3', class: "action-sheet-sub-title" }, this.subHeader))), buttons.map((b) => (h("button", Object.assign({}, b.htmlAttributes, { type: "button", id: b.id, class: buttonClass(b), onClick: () => this.buttonClick(b), disabled: b.disabled }), h("span", { class: "action-sheet-button-inner" }, b.icon && h("ion-icon", { icon: b.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" }), b.text), mode === 'md' && h("ion-ripple-effect", null))))), cancelButton && (h("div", { key: 'f4eb8e3e2885b85af5080df18d0de0bdd1d719de', class: "action-sheet-group action-sheet-group-cancel" }, h("button", Object.assign({ key: '169f4eb09255aba85062baad49ceb151239fbfb7' }, cancelButton.htmlAttributes, { type: "button", class: buttonClass(cancelButton), onClick: () => this.buttonClick(cancelButton) }), h("span", { key: '25fb8a466dd67ea94c79cfb4f9965527e1ce6d42', class: "action-sheet-button-inner" }, cancelButton.icon && (h("ion-icon", { key: 'eb5b071e120a2c86afdf967af6a763a43044d1ca', icon: cancelButton.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" })), cancelButton.text), mode === 'md' && h("ion-ripple-effect", { key: '452ad7e1052b2c681e2d98de8193949755ad4d54' })))))), h("div", { key: 'e1cecf280c987c050d9445e2c458b903f153089b', tabindex: "0", "aria-hidden": "true" })));
301
301
  }
302
302
  get el() { return this; }
303
303
  static get watchers() { return {
@@ -491,7 +491,7 @@ const Alert = /*@__PURE__*/ proxyCustomElement(class Alert extends HTMLElement {
491
491
  const ariaLabelledBy = header ? hdrId : subHeader ? subHdrId : null;
492
492
  return (h(Host, Object.assign({ key: 'c7d53f48b359f2bc3480a2e1ba34948fc9378fb0', role: role, "aria-modal": "true", "aria-labelledby": ariaLabelledBy, "aria-describedby": message !== undefined ? msgId : null, tabindex: "-1" }, htmlAttributes, { style: {
493
493
  zIndex: `${20000 + overlayIndex}`,
494
- }, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { key: '18c7e6b5d63435d9a6a82bda951158e7e1af6e92', tappable: this.backdropDismiss }), h("div", { key: 'e35e1a4b81286976c8a6bab570c986f3196b21f4', tabindex: "0" }), h("div", { key: '9089864c80d96ed834bf723f3de863cf1c4a5b97', class: "alert-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, h("div", { key: 'dd600f02c84352059c6cdf98821b9c9a831bcdcb', class: "alert-head" }, header && (h("h2", { key: '11afb605e1ccefc889fbdd2533d491bea8fbf183', id: hdrId, class: "alert-title" }, header)), subHeader && (h("h2", { key: 'e53b0613d09d26e5a2cd7c9c6e63ec2535625ce5', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), h("div", { key: 'cef60ec8b34c9aec8bc698f16f55324d1ce67c72', tabindex: "0" })));
494
+ }, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { key: '18c7e6b5d63435d9a6a82bda951158e7e1af6e92', tappable: this.backdropDismiss }), h("div", { key: '8ea08a2a70239e817442c12596f51b108aca428c', tabindex: "0", "aria-hidden": "true" }), h("div", { key: '215ca5d72b8b180788e9748f5f22de01fa5a152a', class: "alert-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, h("div", { key: '9880acd318428d4b5d670c67dd156477877f99f2', class: "alert-head" }, header && (h("h2", { key: '612dec8dc9bfdcb36e1e4655dc214b7c229b20c8', id: hdrId, class: "alert-title" }, header)), subHeader && (h("h2", { key: 'e3c54c80a1cd9399595064b5a0a887c16fdc8ff8', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), h("div", { key: '9062655e906b5caf36df6f742fd412552ae510be', tabindex: "0", "aria-hidden": "true" })));
495
495
  }
496
496
  get el() { return this; }
497
497
  static get watchers() { return {
@@ -261,7 +261,7 @@ const Loading = /*@__PURE__*/ proxyCustomElement(class Loading extends HTMLEleme
261
261
  const ariaLabelledBy = message !== undefined ? msgId : null;
262
262
  return (h(Host, Object.assign({ key: 'fb3d2cd7cd0539ed6540d8be50e243c7916b3ca2', role: "dialog", "aria-modal": "true", "aria-labelledby": ariaLabelledBy, tabindex: "-1" }, htmlAttributes, { style: {
263
263
  zIndex: `${40000 + this.overlayIndex}`,
264
- }, onIonBackdropTap: this.onBackdropTap, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'loading-translucent': this.translucent }) }), h("ion-backdrop", { key: 'c8bd30782f3040b1b80e88aa924861e439d40754', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: '4ebfbb67c92e8eb56c27dd7c199b35bf6be1cf63', tabindex: "0" }), h("div", { key: '9492723cd87f1ef75534e449d4bc2b2deb0cb3cc', class: "loading-wrapper ion-overlay-wrapper" }, spinner && (h("div", { key: 'd9eb42454e48c82704d974a68b80ceb4de990417', class: "loading-spinner" }, h("ion-spinner", { key: 'cdb046bad89872f4208ae466979315652766bf3a', name: spinner, "aria-hidden": "true" }))), message !== undefined && this.renderLoadingMessage(msgId)), h("div", { key: '412d1bb537dafa6e6863d07ddc15f5969fe0617d', tabindex: "0" })));
264
+ }, onIonBackdropTap: this.onBackdropTap, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'loading-translucent': this.translucent }) }), h("ion-backdrop", { key: 'c8bd30782f3040b1b80e88aa924861e439d40754', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: '7ad4447fafa49aa861d311221b8c2e8171b4c610', tabindex: "0", "aria-hidden": "true" }), h("div", { key: '1879df0d895eb8ee20ccdc94dd35d708c1140b91', class: "loading-wrapper ion-overlay-wrapper" }, spinner && (h("div", { key: '220f292c136681f5fa91f94669aac75b15e490ce', class: "loading-spinner" }, h("ion-spinner", { key: 'd599084a1426d941bdd080a988d8ad5b9589b823', name: spinner, "aria-hidden": "true" }))), message !== undefined && this.renderLoadingMessage(msgId)), h("div", { key: 'e443897b353a48e0c72718dba04d83d7c5070d73', tabindex: "0", "aria-hidden": "true" })));
265
265
  }
266
266
  get el() { return this; }
267
267
  static get watchers() { return {
@@ -247,7 +247,7 @@ const Picker = /*@__PURE__*/ proxyCustomElement(class Picker extends HTMLElement
247
247
  zIndex: `${20000 + this.overlayIndex}`,
248
248
  }, class: Object.assign({ [mode]: true,
249
249
  // Used internally for styling
250
- [`picker-${mode}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { key: 'da4224447bdbcfbadd1bd63ebe7a7bfdb8aa3129', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: '211475c859b7acf4d64556905c45993201d92d43', tabindex: "0" }), h("div", { key: 'c3b3674038155809caea84ae6348ff0d66897a64', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, h("div", { key: 'a21757da70dc7864945a5751d9da3ca4bf87897b', class: "picker-toolbar" }, this.buttons.map((b) => (h("div", { class: buttonWrapperClass(b) }, h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h("div", { key: '0220da1854d09ef22d2d9a32eaa3c3b222be5a0a', class: "picker-columns" }, h("div", { key: '55757c165ba9e38e56b4dee76a9b13d3ff8b21e6', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => h("ion-picker-legacy-column", { col: c })), h("div", { key: '160092a46a48287bf75e5dfe3502f1755a2d0c70', class: "picker-below-highlight" }))), h("div", { key: 'e212db6cca7d75fc0eda0baf4312dd51b9b7a4ef', tabindex: "0" })));
250
+ [`picker-${mode}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { key: 'da4224447bdbcfbadd1bd63ebe7a7bfdb8aa3129', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: '65eba425990a21be00fdac90de20a630d284cf97', tabindex: "0", "aria-hidden": "true" }), h("div", { key: 'd78ada360801b2c051baa030751f3d83ac81e697', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, h("div", { key: 'd5bd9ddfbdbdaf42048a1496e7939eb3aee6da65', class: "picker-toolbar" }, this.buttons.map((b) => (h("div", { class: buttonWrapperClass(b) }, h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h("div", { key: '96ee1e3ec77c57174b1a93135b66bea6b7002555', class: "picker-columns" }, h("div", { key: 'e11b1c238f350e65bde2ee67eee9d71c830e74e7', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => h("ion-picker-legacy-column", { col: c })), h("div", { key: '4d5fc7c723185111ec01fd34ef95a897c301238d', class: "picker-below-highlight" }))), h("div", { key: '899bcad97609c1d971c1b886551db5ba0248a9f4', tabindex: "0", "aria-hidden": "true" })));
251
251
  }
252
252
  get el() { return this; }
253
253
  static get watchers() { return {
@@ -500,18 +500,10 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
500
500
  if (overlay.presented) {
501
501
  return;
502
502
  }
503
- /**
504
- * Due to accessibility guidelines, toasts do not have
505
- * focus traps.
506
- *
507
- * All other overlays should have focus traps to prevent
508
- * the keyboard focus from leaving the overlay.
509
- */
510
- if (overlay.el.tagName !== 'ION-TOAST') {
511
- setRootAriaHidden(true);
512
- }
503
+ setRootAriaHidden(true);
513
504
  document.body.classList.add(BACKDROP_NO_SCROLL);
514
- hideOverlaysFromScreenReaders(overlay.el);
505
+ hideUnderlyingOverlaysFromScreenReaders(overlay.el);
506
+ hideAnimatingOverlayFromScreenReaders(overlay.el);
515
507
  overlay.presented = true;
516
508
  overlay.willPresent.emit();
517
509
  (_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
@@ -551,6 +543,11 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
551
543
  * it would still have aria-hidden on being presented again.
552
544
  * Removing it here ensures the overlay is visible to screen
553
545
  * readers.
546
+ *
547
+ * If this overlay was being presented, then it was hidden
548
+ * from screen readers during the animation. Now that the
549
+ * animation is complete, we can reveal the overlay to
550
+ * screen readers.
554
551
  */
555
552
  overlay.el.removeAttribute('aria-hidden');
556
553
  };
@@ -608,29 +605,23 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
608
605
  if (!overlay.presented) {
609
606
  return false;
610
607
  }
608
+ const lastOverlay = doc !== undefined && getPresentedOverlays(doc).length === 1;
611
609
  /**
612
- * For accessibility, toasts lack focus traps and don’t receive
613
- * `aria-hidden` on the root element when presented.
614
- *
615
- * All other overlays use focus traps to keep keyboard focus
616
- * within the overlay, setting `aria-hidden` on the root element
617
- * to enhance accessibility.
618
- *
619
- * Therefore, we must remove `aria-hidden` from the root element
620
- * when the last non-toast overlay is dismissed.
610
+ * If this is the last visible overlay then
611
+ * we want to re-add the root to the accessibility tree.
621
612
  */
622
- const overlaysNotToast = doc !== undefined ? getPresentedOverlays(doc).filter((o) => o.tagName !== 'ION-TOAST') : [];
623
- const lastOverlayNotToast = overlaysNotToast.length === 1 && overlaysNotToast[0].id === overlay.el.id;
624
- /**
625
- * If this is the last visible overlay that is not a toast
626
- * then we want to re-add the root to the accessibility tree.
627
- */
628
- if (lastOverlayNotToast) {
613
+ if (lastOverlay) {
629
614
  setRootAriaHidden(false);
630
615
  document.body.classList.remove(BACKDROP_NO_SCROLL);
631
616
  }
632
617
  overlay.presented = false;
633
618
  try {
619
+ /**
620
+ * There is no need to show the overlay to screen readers during
621
+ * the dismiss animation. This is because the overlay will be removed
622
+ * from the DOM after the animation is complete.
623
+ */
624
+ hideAnimatingOverlayFromScreenReaders(overlay.el);
634
625
  // Overlay contents should not be clickable during dismiss
635
626
  overlay.el.style.setProperty('pointer-events', 'none');
636
627
  overlay.willDismiss.emit({ data, role });
@@ -865,6 +856,28 @@ const createTriggerController = () => {
865
856
  removeClickListener,
866
857
  };
867
858
  };
859
+ /**
860
+ * The overlay that is being animated also needs to hide from screen
861
+ * readers during its animation. This ensures that assistive technologies
862
+ * like TalkBack do not announce or interact with the content until the
863
+ * animation is complete, avoiding confusion for users.
864
+ *
865
+ * If the overlay is being presented, it prevents focus rings from appearing
866
+ * in incorrect positions due to the transition (specifically `transform`
867
+ * styles), ensuring that when aria-hidden is removed, the focus rings are
868
+ * correctly displayed in the final location of the elements.
869
+ *
870
+ * @param overlay - The overlay that is being animated.
871
+ */
872
+ const hideAnimatingOverlayFromScreenReaders = (overlay) => {
873
+ if (doc === undefined)
874
+ return;
875
+ /**
876
+ * Once the animation is complete, this attribute will be removed.
877
+ * This is done at the end of the `present` method.
878
+ */
879
+ overlay.setAttribute('aria-hidden', 'true');
880
+ };
868
881
  /**
869
882
  * Ensure that underlying overlays have aria-hidden if necessary so that screen readers
870
883
  * cannot move focus to these elements. Note that we cannot rely on focus/focusin/focusout
@@ -875,7 +888,7 @@ const createTriggerController = () => {
875
888
  * @param newTopMostOverlay - The overlay that is being presented. Since the overlay has not been
876
889
  * fully presented yet at the time this function is called it will not be included in the getPresentedOverlays result.
877
890
  */
878
- const hideOverlaysFromScreenReaders = (newTopMostOverlay) => {
891
+ const hideUnderlyingOverlaysFromScreenReaders = (newTopMostOverlay) => {
879
892
  var _a;
880
893
  if (doc === undefined)
881
894
  return;
@@ -16,7 +16,7 @@ const helpers = require('./helpers-afaa9001.js');
16
16
  const config = require('./config-4f60b98a.js');
17
17
  const theme = require('./theme-d1c573d2.js');
18
18
  const index$2 = require('./index-9cd00dc3.js');
19
- const overlays = require('./overlays-ec7d9b5a.js');
19
+ const overlays = require('./overlays-99f0578e.js');
20
20
  require('./index-c8d52405.js');
21
21
  require('./index-73f75efb.js');
22
22
  require('./index-5915f9b3.js');
@@ -9,7 +9,7 @@ const index = require('./index-73f75efb.js');
9
9
  const buttonActive = require('./button-active-3f2f60b4.js');
10
10
  const helpers = require('./helpers-afaa9001.js');
11
11
  const lockController = require('./lock-controller-6585a42a.js');
12
- const overlays = require('./overlays-ec7d9b5a.js');
12
+ const overlays = require('./overlays-99f0578e.js');
13
13
  const theme = require('./theme-d1c573d2.js');
14
14
  const ionicGlobal = require('./ionic-global-d9a8bb5b.js');
15
15
  const animation = require('./animation-b4fdf128.js');
@@ -302,10 +302,10 @@ const ActionSheet = class {
302
302
  const headerID = `action-sheet-${overlayIndex}-header`;
303
303
  return (index.h(index.Host, Object.assign({ key: '7bbd202ca9e19727e7514abbe073687d982f80c3', role: "dialog", "aria-modal": "true", "aria-labelledby": header !== undefined ? headerID : null, tabindex: "-1" }, htmlAttributes, { style: {
304
304
  zIndex: `${20000 + this.overlayIndex}`,
305
- }, class: Object.assign(Object.assign({ [mode]: true }, theme.getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), index.h("ion-backdrop", { key: '23344a9221a2e6720d7b9de5249dc37256cafa7b', tappable: this.backdropDismiss }), index.h("div", { key: 'd46361bb5cdc32a7922dcf76b566f358a6174bfa', tabindex: "0" }), index.h("div", { key: '136c3f2e77c8a2eac8e9ae4bb13d735e1d62598d', class: "action-sheet-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, index.h("div", { key: '6168ea8b2be42020b2edeb8ff3a0f3d1254be37a', class: "action-sheet-container" }, index.h("div", { key: '29b9e6619dc54574733a704d6bf885839151bd84', class: "action-sheet-group", ref: (el) => (this.groupEl = el) }, header !== undefined && (index.h("div", { key: '536ce764bfddb3816ea3512d90f4acef2ccb8589', id: headerID, class: {
305
+ }, class: Object.assign(Object.assign({ [mode]: true }, theme.getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), index.h("ion-backdrop", { key: '23344a9221a2e6720d7b9de5249dc37256cafa7b', tappable: this.backdropDismiss }), index.h("div", { key: 'fbc2ba15549c2ab04e759e82df6e177fd80cc0a6', tabindex: "0", "aria-hidden": "true" }), index.h("div", { key: '748ee5235d0b4cb26d6f1b7589f77af2e37ad28a', class: "action-sheet-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, index.h("div", { key: '7ce5fa236cf75e9b1e49c4725c9a811078706554', class: "action-sheet-container" }, index.h("div", { key: 'dc2251f3bcee4a93e3449f09621cbd2b65d329e9', class: "action-sheet-group", ref: (el) => (this.groupEl = el) }, header !== undefined && (index.h("div", { key: '48d325c8a852f56ed57a9ada1a6709d05ba32ee2', id: headerID, class: {
306
306
  'action-sheet-title': true,
307
307
  'action-sheet-has-sub-title': this.subHeader !== undefined,
308
- } }, header, this.subHeader && index.h("div", { key: '6d888219145824fd36cdfe0d3c8388bbf2769777', class: "action-sheet-sub-title" }, this.subHeader))), buttons.map((b) => (index.h("button", Object.assign({}, b.htmlAttributes, { type: "button", id: b.id, class: buttonClass(b), onClick: () => this.buttonClick(b), disabled: b.disabled }), index.h("span", { class: "action-sheet-button-inner" }, b.icon && index.h("ion-icon", { icon: b.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" }), b.text), mode === 'md' && index.h("ion-ripple-effect", null))))), cancelButton && (index.h("div", { key: '46f98f0ed5a9bdb3e35feb9ae71c4489c17b7d77', class: "action-sheet-group action-sheet-group-cancel" }, index.h("button", Object.assign({ key: 'e3c457bced8ad5f692e48de26e65f731fd631b4f' }, cancelButton.htmlAttributes, { type: "button", class: buttonClass(cancelButton), onClick: () => this.buttonClick(cancelButton) }), index.h("span", { key: '4cba6dc559f734ecc852e024959210cd0dd25354', class: "action-sheet-button-inner" }, cancelButton.icon && (index.h("ion-icon", { key: '9df64989aad1b4d1e75edf4d37ab208965cfe37f', icon: cancelButton.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" })), cancelButton.text), mode === 'md' && index.h("ion-ripple-effect", { key: '558089275a29177cefdb2e38eefc9b5c8b62872b' })))))), index.h("div", { key: 'fa4df6e043b00a6e4126dbc71cb344cfc2b2e7bc', tabindex: "0" })));
308
+ } }, header, this.subHeader && index.h("div", { key: '66093728052eb67f37a35f3232761ce4a08896f3', class: "action-sheet-sub-title" }, this.subHeader))), buttons.map((b) => (index.h("button", Object.assign({}, b.htmlAttributes, { type: "button", id: b.id, class: buttonClass(b), onClick: () => this.buttonClick(b), disabled: b.disabled }), index.h("span", { class: "action-sheet-button-inner" }, b.icon && index.h("ion-icon", { icon: b.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" }), b.text), mode === 'md' && index.h("ion-ripple-effect", null))))), cancelButton && (index.h("div", { key: 'f4eb8e3e2885b85af5080df18d0de0bdd1d719de', class: "action-sheet-group action-sheet-group-cancel" }, index.h("button", Object.assign({ key: '169f4eb09255aba85062baad49ceb151239fbfb7' }, cancelButton.htmlAttributes, { type: "button", class: buttonClass(cancelButton), onClick: () => this.buttonClick(cancelButton) }), index.h("span", { key: '25fb8a466dd67ea94c79cfb4f9965527e1ce6d42', class: "action-sheet-button-inner" }, cancelButton.icon && (index.h("ion-icon", { key: 'eb5b071e120a2c86afdf967af6a763a43044d1ca', icon: cancelButton.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" })), cancelButton.text), mode === 'md' && index.h("ion-ripple-effect", { key: '452ad7e1052b2c681e2d98de8193949755ad4d54' })))))), index.h("div", { key: 'e1cecf280c987c050d9445e2c458b903f153089b', tabindex: "0", "aria-hidden": "true" })));
309
309
  }
310
310
  get el() { return index.getElement(this); }
311
311
  static get watchers() { return {
@@ -10,7 +10,7 @@ const config = require('./config-4f60b98a.js');
10
10
  const buttonActive = require('./button-active-3f2f60b4.js');
11
11
  const helpers = require('./helpers-afaa9001.js');
12
12
  const lockController = require('./lock-controller-6585a42a.js');
13
- const overlays = require('./overlays-ec7d9b5a.js');
13
+ const overlays = require('./overlays-99f0578e.js');
14
14
  const theme = require('./theme-d1c573d2.js');
15
15
  const ionicGlobal = require('./ionic-global-d9a8bb5b.js');
16
16
  const animation = require('./animation-b4fdf128.js');
@@ -500,7 +500,7 @@ const Alert = class {
500
500
  const ariaLabelledBy = header ? hdrId : subHeader ? subHdrId : null;
501
501
  return (index.h(index.Host, Object.assign({ key: 'c7d53f48b359f2bc3480a2e1ba34948fc9378fb0', role: role, "aria-modal": "true", "aria-labelledby": ariaLabelledBy, "aria-describedby": message !== undefined ? msgId : null, tabindex: "-1" }, htmlAttributes, { style: {
502
502
  zIndex: `${20000 + overlayIndex}`,
503
- }, class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), index.h("ion-backdrop", { key: '18c7e6b5d63435d9a6a82bda951158e7e1af6e92', tappable: this.backdropDismiss }), index.h("div", { key: 'e35e1a4b81286976c8a6bab570c986f3196b21f4', tabindex: "0" }), index.h("div", { key: '9089864c80d96ed834bf723f3de863cf1c4a5b97', class: "alert-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, index.h("div", { key: 'dd600f02c84352059c6cdf98821b9c9a831bcdcb', class: "alert-head" }, header && (index.h("h2", { key: '11afb605e1ccefc889fbdd2533d491bea8fbf183', id: hdrId, class: "alert-title" }, header)), subHeader && (index.h("h2", { key: 'e53b0613d09d26e5a2cd7c9c6e63ec2535625ce5', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), index.h("div", { key: 'cef60ec8b34c9aec8bc698f16f55324d1ce67c72', tabindex: "0" })));
503
+ }, class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), index.h("ion-backdrop", { key: '18c7e6b5d63435d9a6a82bda951158e7e1af6e92', tappable: this.backdropDismiss }), index.h("div", { key: '8ea08a2a70239e817442c12596f51b108aca428c', tabindex: "0", "aria-hidden": "true" }), index.h("div", { key: '215ca5d72b8b180788e9748f5f22de01fa5a152a', class: "alert-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, index.h("div", { key: '9880acd318428d4b5d670c67dd156477877f99f2', class: "alert-head" }, header && (index.h("h2", { key: '612dec8dc9bfdcb36e1e4655dc214b7c229b20c8', id: hdrId, class: "alert-title" }, header)), subHeader && (index.h("h2", { key: 'e3c54c80a1cd9399595064b5a0a887c16fdc8ff8', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), index.h("div", { key: '9062655e906b5caf36df6f742fd412552ae510be', tabindex: "0", "aria-hidden": "true" })));
504
504
  }
505
505
  get el() { return index.getElement(this); }
506
506
  static get watchers() { return {
@@ -15,7 +15,7 @@ const index$2 = require('./index-073c7cdc.js');
15
15
  const ionicGlobal = require('./ionic-global-d9a8bb5b.js');
16
16
  const data = require('./data-21dc0f81.js');
17
17
  const lockController = require('./lock-controller-6585a42a.js');
18
- const overlays = require('./overlays-ec7d9b5a.js');
18
+ const overlays = require('./overlays-99f0578e.js');
19
19
  const animation = require('./animation-b4fdf128.js');
20
20
  const haptic = require('./haptic-f6b37aa3.js');
21
21
  require('./index-c8d52405.js');
@@ -2034,7 +2034,7 @@ const Picker = class {
2034
2034
  zIndex: `${20000 + this.overlayIndex}`,
2035
2035
  }, class: Object.assign({ [mode]: true,
2036
2036
  // Used internally for styling
2037
- [`picker-${mode}`]: true, 'overlay-hidden': true }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), index$1.h("ion-backdrop", { key: 'da4224447bdbcfbadd1bd63ebe7a7bfdb8aa3129', visible: this.showBackdrop, tappable: this.backdropDismiss }), index$1.h("div", { key: '211475c859b7acf4d64556905c45993201d92d43', tabindex: "0" }), index$1.h("div", { key: 'c3b3674038155809caea84ae6348ff0d66897a64', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, index$1.h("div", { key: 'a21757da70dc7864945a5751d9da3ca4bf87897b', class: "picker-toolbar" }, this.buttons.map((b) => (index$1.h("div", { class: buttonWrapperClass(b) }, index$1.h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), index$1.h("div", { key: '0220da1854d09ef22d2d9a32eaa3c3b222be5a0a', class: "picker-columns" }, index$1.h("div", { key: '55757c165ba9e38e56b4dee76a9b13d3ff8b21e6', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => index$1.h("ion-picker-legacy-column", { col: c })), index$1.h("div", { key: '160092a46a48287bf75e5dfe3502f1755a2d0c70', class: "picker-below-highlight" }))), index$1.h("div", { key: 'e212db6cca7d75fc0eda0baf4312dd51b9b7a4ef', tabindex: "0" })));
2037
+ [`picker-${mode}`]: true, 'overlay-hidden': true }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), index$1.h("ion-backdrop", { key: 'da4224447bdbcfbadd1bd63ebe7a7bfdb8aa3129', visible: this.showBackdrop, tappable: this.backdropDismiss }), index$1.h("div", { key: '65eba425990a21be00fdac90de20a630d284cf97', tabindex: "0", "aria-hidden": "true" }), index$1.h("div", { key: 'd78ada360801b2c051baa030751f3d83ac81e697', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, index$1.h("div", { key: 'd5bd9ddfbdbdaf42048a1496e7939eb3aee6da65', class: "picker-toolbar" }, this.buttons.map((b) => (index$1.h("div", { class: buttonWrapperClass(b) }, index$1.h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), index$1.h("div", { key: '96ee1e3ec77c57174b1a93135b66bea6b7002555', class: "picker-columns" }, index$1.h("div", { key: 'e11b1c238f350e65bde2ee67eee9d71c830e74e7', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => index$1.h("ion-picker-legacy-column", { col: c })), index$1.h("div", { key: '4d5fc7c723185111ec01fd34ef95a897c301238d', class: "picker-below-highlight" }))), index$1.h("div", { key: '899bcad97609c1d971c1b886551db5ba0248a9f4', tabindex: "0", "aria-hidden": "true" })));
2038
2038
  }
2039
2039
  get el() { return index$1.getElement(this); }
2040
2040
  static get watchers() { return {
@@ -9,7 +9,7 @@ const index = require('./index-73f75efb.js');
9
9
  const config = require('./config-4f60b98a.js');
10
10
  const helpers = require('./helpers-afaa9001.js');
11
11
  const lockController = require('./lock-controller-6585a42a.js');
12
- const overlays = require('./overlays-ec7d9b5a.js');
12
+ const overlays = require('./overlays-99f0578e.js');
13
13
  const theme = require('./theme-d1c573d2.js');
14
14
  const ionicGlobal = require('./ionic-global-d9a8bb5b.js');
15
15
  const animation = require('./animation-b4fdf128.js');
@@ -267,7 +267,7 @@ const Loading = class {
267
267
  const ariaLabelledBy = message !== undefined ? msgId : null;
268
268
  return (index.h(index.Host, Object.assign({ key: 'fb3d2cd7cd0539ed6540d8be50e243c7916b3ca2', role: "dialog", "aria-modal": "true", "aria-labelledby": ariaLabelledBy, tabindex: "-1" }, htmlAttributes, { style: {
269
269
  zIndex: `${40000 + this.overlayIndex}`,
270
- }, onIonBackdropTap: this.onBackdropTap, class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'loading-translucent': this.translucent }) }), index.h("ion-backdrop", { key: 'c8bd30782f3040b1b80e88aa924861e439d40754', visible: this.showBackdrop, tappable: this.backdropDismiss }), index.h("div", { key: '4ebfbb67c92e8eb56c27dd7c199b35bf6be1cf63', tabindex: "0" }), index.h("div", { key: '9492723cd87f1ef75534e449d4bc2b2deb0cb3cc', class: "loading-wrapper ion-overlay-wrapper" }, spinner && (index.h("div", { key: 'd9eb42454e48c82704d974a68b80ceb4de990417', class: "loading-spinner" }, index.h("ion-spinner", { key: 'cdb046bad89872f4208ae466979315652766bf3a', name: spinner, "aria-hidden": "true" }))), message !== undefined && this.renderLoadingMessage(msgId)), index.h("div", { key: '412d1bb537dafa6e6863d07ddc15f5969fe0617d', tabindex: "0" })));
270
+ }, onIonBackdropTap: this.onBackdropTap, class: Object.assign(Object.assign({}, theme.getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'loading-translucent': this.translucent }) }), index.h("ion-backdrop", { key: 'c8bd30782f3040b1b80e88aa924861e439d40754', visible: this.showBackdrop, tappable: this.backdropDismiss }), index.h("div", { key: '7ad4447fafa49aa861d311221b8c2e8171b4c610', tabindex: "0", "aria-hidden": "true" }), index.h("div", { key: '1879df0d895eb8ee20ccdc94dd35d708c1140b91', class: "loading-wrapper ion-overlay-wrapper" }, spinner && (index.h("div", { key: '220f292c136681f5fa91f94669aac75b15e490ce', class: "loading-spinner" }, index.h("ion-spinner", { key: 'd599084a1426d941bdd080a988d8ad5b9589b823', name: spinner, "aria-hidden": "true" }))), message !== undefined && this.renderLoadingMessage(msgId)), index.h("div", { key: 'e443897b353a48e0c72718dba04d83d7c5070d73', tabindex: "0", "aria-hidden": "true" })));
271
271
  }
272
272
  get el() { return index.getElement(this); }
273
273
  static get watchers() { return {
@@ -7,7 +7,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-73f75efb.js');
9
9
  const cubicBezier = require('./cubic-bezier-f2dccc53.js');
10
- const overlays = require('./overlays-ec7d9b5a.js');
10
+ const overlays = require('./overlays-99f0578e.js');
11
11
  const gestureController = require('./gesture-controller-9436f482.js');
12
12
  const hardwareBackButton = require('./hardware-back-button-9e8a2c4f.js');
13
13
  const helpers = require('./helpers-afaa9001.js');
@@ -12,7 +12,7 @@ const helpers = require('./helpers-afaa9001.js');
12
12
  const lockController = require('./lock-controller-6585a42a.js');
13
13
  const index$4 = require('./index-5915f9b3.js');
14
14
  const capacitor = require('./capacitor-c04564bf.js');
15
- const overlays = require('./overlays-ec7d9b5a.js');
15
+ const overlays = require('./overlays-99f0578e.js');
16
16
  const theme = require('./theme-d1c573d2.js');
17
17
  const index$5 = require('./index-f05acd21.js');
18
18
  const ionicGlobal = require('./ionic-global-d9a8bb5b.js');
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-73f75efb.js');
9
- const overlays = require('./overlays-ec7d9b5a.js');
9
+ const overlays = require('./overlays-99f0578e.js');
10
10
  const frameworkDelegate = require('./framework-delegate-55f5683a.js');
11
11
  const helpers = require('./helpers-afaa9001.js');
12
12
  const lockController = require('./lock-controller-6585a42a.js');
@@ -9,7 +9,7 @@ const index = require('./index-73f75efb.js');
9
9
  const notchController = require('./notch-controller-d69150f5.js');
10
10
  const compareWithUtils = require('./compare-with-utils-df1001d7.js');
11
11
  const helpers = require('./helpers-afaa9001.js');
12
- const overlays = require('./overlays-ec7d9b5a.js');
12
+ const overlays = require('./overlays-99f0578e.js');
13
13
  const dir = require('./dir-94c21456.js');
14
14
  const theme = require('./theme-d1c573d2.js');
15
15
  const watchOptions = require('./watch-options-f5f3e158.js');
@@ -10,7 +10,7 @@ const config = require('./config-4f60b98a.js');
10
10
  const helpers = require('./helpers-afaa9001.js');
11
11
  const lockController = require('./lock-controller-6585a42a.js');
12
12
  const index$1 = require('./index-5915f9b3.js');
13
- const overlays = require('./overlays-ec7d9b5a.js');
13
+ const overlays = require('./overlays-99f0578e.js');
14
14
  const theme = require('./theme-d1c573d2.js');
15
15
  const ionicGlobal = require('./ionic-global-d9a8bb5b.js');
16
16
  const animation = require('./animation-b4fdf128.js');
@@ -502,18 +502,10 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
502
502
  if (overlay.presented) {
503
503
  return;
504
504
  }
505
- /**
506
- * Due to accessibility guidelines, toasts do not have
507
- * focus traps.
508
- *
509
- * All other overlays should have focus traps to prevent
510
- * the keyboard focus from leaving the overlay.
511
- */
512
- if (overlay.el.tagName !== 'ION-TOAST') {
513
- setRootAriaHidden(true);
514
- }
505
+ setRootAriaHidden(true);
515
506
  document.body.classList.add(gestureController.BACKDROP_NO_SCROLL);
516
- hideOverlaysFromScreenReaders(overlay.el);
507
+ hideUnderlyingOverlaysFromScreenReaders(overlay.el);
508
+ hideAnimatingOverlayFromScreenReaders(overlay.el);
517
509
  overlay.presented = true;
518
510
  overlay.willPresent.emit();
519
511
  (_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
@@ -553,6 +545,11 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
553
545
  * it would still have aria-hidden on being presented again.
554
546
  * Removing it here ensures the overlay is visible to screen
555
547
  * readers.
548
+ *
549
+ * If this overlay was being presented, then it was hidden
550
+ * from screen readers during the animation. Now that the
551
+ * animation is complete, we can reveal the overlay to
552
+ * screen readers.
556
553
  */
557
554
  overlay.el.removeAttribute('aria-hidden');
558
555
  };
@@ -610,29 +607,23 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
610
607
  if (!overlay.presented) {
611
608
  return false;
612
609
  }
610
+ const lastOverlay = index.doc !== undefined && getPresentedOverlays(index.doc).length === 1;
613
611
  /**
614
- * For accessibility, toasts lack focus traps and don’t receive
615
- * `aria-hidden` on the root element when presented.
616
- *
617
- * All other overlays use focus traps to keep keyboard focus
618
- * within the overlay, setting `aria-hidden` on the root element
619
- * to enhance accessibility.
620
- *
621
- * Therefore, we must remove `aria-hidden` from the root element
622
- * when the last non-toast overlay is dismissed.
612
+ * If this is the last visible overlay then
613
+ * we want to re-add the root to the accessibility tree.
623
614
  */
624
- const overlaysNotToast = index.doc !== undefined ? getPresentedOverlays(index.doc).filter((o) => o.tagName !== 'ION-TOAST') : [];
625
- const lastOverlayNotToast = overlaysNotToast.length === 1 && overlaysNotToast[0].id === overlay.el.id;
626
- /**
627
- * If this is the last visible overlay that is not a toast
628
- * then we want to re-add the root to the accessibility tree.
629
- */
630
- if (lastOverlayNotToast) {
615
+ if (lastOverlay) {
631
616
  setRootAriaHidden(false);
632
617
  document.body.classList.remove(gestureController.BACKDROP_NO_SCROLL);
633
618
  }
634
619
  overlay.presented = false;
635
620
  try {
621
+ /**
622
+ * There is no need to show the overlay to screen readers during
623
+ * the dismiss animation. This is because the overlay will be removed
624
+ * from the DOM after the animation is complete.
625
+ */
626
+ hideAnimatingOverlayFromScreenReaders(overlay.el);
636
627
  // Overlay contents should not be clickable during dismiss
637
628
  overlay.el.style.setProperty('pointer-events', 'none');
638
629
  overlay.willDismiss.emit({ data, role });
@@ -867,6 +858,28 @@ const createTriggerController = () => {
867
858
  removeClickListener,
868
859
  };
869
860
  };
861
+ /**
862
+ * The overlay that is being animated also needs to hide from screen
863
+ * readers during its animation. This ensures that assistive technologies
864
+ * like TalkBack do not announce or interact with the content until the
865
+ * animation is complete, avoiding confusion for users.
866
+ *
867
+ * If the overlay is being presented, it prevents focus rings from appearing
868
+ * in incorrect positions due to the transition (specifically `transform`
869
+ * styles), ensuring that when aria-hidden is removed, the focus rings are
870
+ * correctly displayed in the final location of the elements.
871
+ *
872
+ * @param overlay - The overlay that is being animated.
873
+ */
874
+ const hideAnimatingOverlayFromScreenReaders = (overlay) => {
875
+ if (index.doc === undefined)
876
+ return;
877
+ /**
878
+ * Once the animation is complete, this attribute will be removed.
879
+ * This is done at the end of the `present` method.
880
+ */
881
+ overlay.setAttribute('aria-hidden', 'true');
882
+ };
870
883
  /**
871
884
  * Ensure that underlying overlays have aria-hidden if necessary so that screen readers
872
885
  * cannot move focus to these elements. Note that we cannot rely on focus/focusin/focusout
@@ -877,7 +890,7 @@ const createTriggerController = () => {
877
890
  * @param newTopMostOverlay - The overlay that is being presented. Since the overlay has not been
878
891
  * fully presented yet at the time this function is called it will not be included in the getPresentedOverlays result.
879
892
  */
880
- const hideOverlaysFromScreenReaders = (newTopMostOverlay) => {
893
+ const hideUnderlyingOverlaysFromScreenReaders = (newTopMostOverlay) => {
881
894
  var _a;
882
895
  if (index.doc === undefined)
883
896
  return;
@@ -196,10 +196,10 @@ export class ActionSheet {
196
196
  const headerID = `action-sheet-${overlayIndex}-header`;
197
197
  return (h(Host, Object.assign({ key: '7bbd202ca9e19727e7514abbe073687d982f80c3', role: "dialog", "aria-modal": "true", "aria-labelledby": header !== undefined ? headerID : null, tabindex: "-1" }, htmlAttributes, { style: {
198
198
  zIndex: `${20000 + this.overlayIndex}`,
199
- }, class: Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { key: '23344a9221a2e6720d7b9de5249dc37256cafa7b', tappable: this.backdropDismiss }), h("div", { key: 'd46361bb5cdc32a7922dcf76b566f358a6174bfa', tabindex: "0" }), h("div", { key: '136c3f2e77c8a2eac8e9ae4bb13d735e1d62598d', class: "action-sheet-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, h("div", { key: '6168ea8b2be42020b2edeb8ff3a0f3d1254be37a', class: "action-sheet-container" }, h("div", { key: '29b9e6619dc54574733a704d6bf885839151bd84', class: "action-sheet-group", ref: (el) => (this.groupEl = el) }, header !== undefined && (h("div", { key: '536ce764bfddb3816ea3512d90f4acef2ccb8589', id: headerID, class: {
199
+ }, class: Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { key: '23344a9221a2e6720d7b9de5249dc37256cafa7b', tappable: this.backdropDismiss }), h("div", { key: 'fbc2ba15549c2ab04e759e82df6e177fd80cc0a6', tabindex: "0", "aria-hidden": "true" }), h("div", { key: '748ee5235d0b4cb26d6f1b7589f77af2e37ad28a', class: "action-sheet-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, h("div", { key: '7ce5fa236cf75e9b1e49c4725c9a811078706554', class: "action-sheet-container" }, h("div", { key: 'dc2251f3bcee4a93e3449f09621cbd2b65d329e9', class: "action-sheet-group", ref: (el) => (this.groupEl = el) }, header !== undefined && (h("div", { key: '48d325c8a852f56ed57a9ada1a6709d05ba32ee2', id: headerID, class: {
200
200
  'action-sheet-title': true,
201
201
  'action-sheet-has-sub-title': this.subHeader !== undefined,
202
- } }, header, this.subHeader && h("div", { key: '6d888219145824fd36cdfe0d3c8388bbf2769777', class: "action-sheet-sub-title" }, this.subHeader))), buttons.map((b) => (h("button", Object.assign({}, b.htmlAttributes, { type: "button", id: b.id, class: buttonClass(b), onClick: () => this.buttonClick(b), disabled: b.disabled }), h("span", { class: "action-sheet-button-inner" }, b.icon && h("ion-icon", { icon: b.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" }), b.text), mode === 'md' && h("ion-ripple-effect", null))))), cancelButton && (h("div", { key: '46f98f0ed5a9bdb3e35feb9ae71c4489c17b7d77', class: "action-sheet-group action-sheet-group-cancel" }, h("button", Object.assign({ key: 'e3c457bced8ad5f692e48de26e65f731fd631b4f' }, cancelButton.htmlAttributes, { type: "button", class: buttonClass(cancelButton), onClick: () => this.buttonClick(cancelButton) }), h("span", { key: '4cba6dc559f734ecc852e024959210cd0dd25354', class: "action-sheet-button-inner" }, cancelButton.icon && (h("ion-icon", { key: '9df64989aad1b4d1e75edf4d37ab208965cfe37f', icon: cancelButton.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" })), cancelButton.text), mode === 'md' && h("ion-ripple-effect", { key: '558089275a29177cefdb2e38eefc9b5c8b62872b' })))))), h("div", { key: 'fa4df6e043b00a6e4126dbc71cb344cfc2b2e7bc', tabindex: "0" })));
202
+ } }, header, this.subHeader && h("div", { key: '66093728052eb67f37a35f3232761ce4a08896f3', class: "action-sheet-sub-title" }, this.subHeader))), buttons.map((b) => (h("button", Object.assign({}, b.htmlAttributes, { type: "button", id: b.id, class: buttonClass(b), onClick: () => this.buttonClick(b), disabled: b.disabled }), h("span", { class: "action-sheet-button-inner" }, b.icon && h("ion-icon", { icon: b.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" }), b.text), mode === 'md' && h("ion-ripple-effect", null))))), cancelButton && (h("div", { key: 'f4eb8e3e2885b85af5080df18d0de0bdd1d719de', class: "action-sheet-group action-sheet-group-cancel" }, h("button", Object.assign({ key: '169f4eb09255aba85062baad49ceb151239fbfb7' }, cancelButton.htmlAttributes, { type: "button", class: buttonClass(cancelButton), onClick: () => this.buttonClick(cancelButton) }), h("span", { key: '25fb8a466dd67ea94c79cfb4f9965527e1ce6d42', class: "action-sheet-button-inner" }, cancelButton.icon && (h("ion-icon", { key: 'eb5b071e120a2c86afdf967af6a763a43044d1ca', icon: cancelButton.icon, "aria-hidden": "true", lazy: false, class: "action-sheet-icon" })), cancelButton.text), mode === 'md' && h("ion-ripple-effect", { key: '452ad7e1052b2c681e2d98de8193949755ad4d54' })))))), h("div", { key: 'e1cecf280c987c050d9445e2c458b903f153089b', tabindex: "0", "aria-hidden": "true" })));
203
203
  }
204
204
  static get is() { return "ion-action-sheet"; }
205
205
  static get encapsulation() { return "scoped"; }
@@ -396,7 +396,7 @@ export class Alert {
396
396
  const ariaLabelledBy = header ? hdrId : subHeader ? subHdrId : null;
397
397
  return (h(Host, Object.assign({ key: 'c7d53f48b359f2bc3480a2e1ba34948fc9378fb0', role: role, "aria-modal": "true", "aria-labelledby": ariaLabelledBy, "aria-describedby": message !== undefined ? msgId : null, tabindex: "-1" }, htmlAttributes, { style: {
398
398
  zIndex: `${20000 + overlayIndex}`,
399
- }, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { key: '18c7e6b5d63435d9a6a82bda951158e7e1af6e92', tappable: this.backdropDismiss }), h("div", { key: 'e35e1a4b81286976c8a6bab570c986f3196b21f4', tabindex: "0" }), h("div", { key: '9089864c80d96ed834bf723f3de863cf1c4a5b97', class: "alert-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, h("div", { key: 'dd600f02c84352059c6cdf98821b9c9a831bcdcb', class: "alert-head" }, header && (h("h2", { key: '11afb605e1ccefc889fbdd2533d491bea8fbf183', id: hdrId, class: "alert-title" }, header)), subHeader && (h("h2", { key: 'e53b0613d09d26e5a2cd7c9c6e63ec2535625ce5', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), h("div", { key: 'cef60ec8b34c9aec8bc698f16f55324d1ce67c72', tabindex: "0" })));
399
+ }, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }), h("ion-backdrop", { key: '18c7e6b5d63435d9a6a82bda951158e7e1af6e92', tappable: this.backdropDismiss }), h("div", { key: '8ea08a2a70239e817442c12596f51b108aca428c', tabindex: "0", "aria-hidden": "true" }), h("div", { key: '215ca5d72b8b180788e9748f5f22de01fa5a152a', class: "alert-wrapper ion-overlay-wrapper", ref: (el) => (this.wrapperEl = el) }, h("div", { key: '9880acd318428d4b5d670c67dd156477877f99f2', class: "alert-head" }, header && (h("h2", { key: '612dec8dc9bfdcb36e1e4655dc214b7c229b20c8', id: hdrId, class: "alert-title" }, header)), subHeader && (h("h2", { key: 'e3c54c80a1cd9399595064b5a0a887c16fdc8ff8', id: subHdrId, class: "alert-sub-title" }, subHeader))), this.renderAlertMessage(msgId), this.renderAlertInputs(), this.renderAlertButtons()), h("div", { key: '9062655e906b5caf36df6f742fd412552ae510be', tabindex: "0", "aria-hidden": "true" })));
400
400
  }
401
401
  static get is() { return "ion-alert"; }
402
402
  static get encapsulation() { return "scoped"; }
@@ -163,7 +163,7 @@ export class Loading {
163
163
  const ariaLabelledBy = message !== undefined ? msgId : null;
164
164
  return (h(Host, Object.assign({ key: 'fb3d2cd7cd0539ed6540d8be50e243c7916b3ca2', role: "dialog", "aria-modal": "true", "aria-labelledby": ariaLabelledBy, tabindex: "-1" }, htmlAttributes, { style: {
165
165
  zIndex: `${40000 + this.overlayIndex}`,
166
- }, onIonBackdropTap: this.onBackdropTap, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'loading-translucent': this.translucent }) }), h("ion-backdrop", { key: 'c8bd30782f3040b1b80e88aa924861e439d40754', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: '4ebfbb67c92e8eb56c27dd7c199b35bf6be1cf63', tabindex: "0" }), h("div", { key: '9492723cd87f1ef75534e449d4bc2b2deb0cb3cc', class: "loading-wrapper ion-overlay-wrapper" }, spinner && (h("div", { key: 'd9eb42454e48c82704d974a68b80ceb4de990417', class: "loading-spinner" }, h("ion-spinner", { key: 'cdb046bad89872f4208ae466979315652766bf3a', name: spinner, "aria-hidden": "true" }))), message !== undefined && this.renderLoadingMessage(msgId)), h("div", { key: '412d1bb537dafa6e6863d07ddc15f5969fe0617d', tabindex: "0" })));
166
+ }, onIonBackdropTap: this.onBackdropTap, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'overlay-hidden': true, 'loading-translucent': this.translucent }) }), h("ion-backdrop", { key: 'c8bd30782f3040b1b80e88aa924861e439d40754', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: '7ad4447fafa49aa861d311221b8c2e8171b4c610', tabindex: "0", "aria-hidden": "true" }), h("div", { key: '1879df0d895eb8ee20ccdc94dd35d708c1140b91', class: "loading-wrapper ion-overlay-wrapper" }, spinner && (h("div", { key: '220f292c136681f5fa91f94669aac75b15e490ce', class: "loading-spinner" }, h("ion-spinner", { key: 'd599084a1426d941bdd080a988d8ad5b9589b823', name: spinner, "aria-hidden": "true" }))), message !== undefined && this.renderLoadingMessage(msgId)), h("div", { key: 'e443897b353a48e0c72718dba04d83d7c5070d73', tabindex: "0", "aria-hidden": "true" })));
167
167
  }
168
168
  static get is() { return "ion-loading"; }
169
169
  static get encapsulation() { return "scoped"; }
@@ -189,7 +189,7 @@ export class Picker {
189
189
  zIndex: `${20000 + this.overlayIndex}`,
190
190
  }, class: Object.assign({ [mode]: true,
191
191
  // Used internally for styling
192
- [`picker-${mode}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { key: 'da4224447bdbcfbadd1bd63ebe7a7bfdb8aa3129', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: '211475c859b7acf4d64556905c45993201d92d43', tabindex: "0" }), h("div", { key: 'c3b3674038155809caea84ae6348ff0d66897a64', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, h("div", { key: 'a21757da70dc7864945a5751d9da3ca4bf87897b', class: "picker-toolbar" }, this.buttons.map((b) => (h("div", { class: buttonWrapperClass(b) }, h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h("div", { key: '0220da1854d09ef22d2d9a32eaa3c3b222be5a0a', class: "picker-columns" }, h("div", { key: '55757c165ba9e38e56b4dee76a9b13d3ff8b21e6', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => h("ion-picker-legacy-column", { col: c })), h("div", { key: '160092a46a48287bf75e5dfe3502f1755a2d0c70', class: "picker-below-highlight" }))), h("div", { key: 'e212db6cca7d75fc0eda0baf4312dd51b9b7a4ef', tabindex: "0" })));
192
+ [`picker-${mode}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { key: 'da4224447bdbcfbadd1bd63ebe7a7bfdb8aa3129', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: '65eba425990a21be00fdac90de20a630d284cf97', tabindex: "0", "aria-hidden": "true" }), h("div", { key: 'd78ada360801b2c051baa030751f3d83ac81e697', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, h("div", { key: 'd5bd9ddfbdbdaf42048a1496e7939eb3aee6da65', class: "picker-toolbar" }, this.buttons.map((b) => (h("div", { class: buttonWrapperClass(b) }, h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h("div", { key: '96ee1e3ec77c57174b1a93135b66bea6b7002555', class: "picker-columns" }, h("div", { key: 'e11b1c238f350e65bde2ee67eee9d71c830e74e7', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => h("ion-picker-legacy-column", { col: c })), h("div", { key: '4d5fc7c723185111ec01fd34ef95a897c301238d', class: "picker-below-highlight" }))), h("div", { key: '899bcad97609c1d971c1b886551db5ba0248a9f4', tabindex: "0", "aria-hidden": "true" })));
193
193
  }
194
194
  static get is() { return "ion-picker-legacy"; }
195
195
  static get encapsulation() { return "scoped"; }