@ionic/core 8.6.3-dev.11751478001.1cb7436f → 8.6.3-nightly.20250620

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 (92) hide show
  1. package/components/action-sheet.js +9 -8
  2. package/components/alert.js +8 -7
  3. package/components/focus-visible.js +18 -27
  4. package/components/ion-app.js +1 -3
  5. package/components/ion-datetime.js +2 -8
  6. package/components/ion-loading.js +8 -7
  7. package/components/ion-menu.js +5 -27
  8. package/components/ion-reorder-group.js +2 -1
  9. package/components/ion-router.js +0 -1
  10. package/components/ion-searchbar.js +6 -4
  11. package/components/ion-select.js +3 -3
  12. package/components/ion-toast.js +7 -6
  13. package/components/modal.js +10 -26
  14. package/components/popover.js +7 -8
  15. package/dist/cjs/{focus-visible-ZV7jHMPt.js → focus-visible-CCvKiLh3.js} +18 -27
  16. package/dist/cjs/ion-action-sheet.cjs.entry.js +9 -8
  17. package/dist/cjs/ion-alert.cjs.entry.js +8 -7
  18. package/dist/cjs/ion-app_8.cjs.entry.js +2 -4
  19. package/dist/cjs/ion-datetime_3.cjs.entry.js +3 -9
  20. package/dist/cjs/ion-loading.cjs.entry.js +8 -7
  21. package/dist/cjs/ion-menu_3.cjs.entry.js +5 -27
  22. package/dist/cjs/ion-modal.cjs.entry.js +10 -26
  23. package/dist/cjs/ion-popover.cjs.entry.js +7 -8
  24. package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -1
  25. package/dist/cjs/ion-route_4.cjs.entry.js +0 -1
  26. package/dist/cjs/ion-searchbar.cjs.entry.js +6 -4
  27. package/dist/cjs/ion-select_3.cjs.entry.js +3 -3
  28. package/dist/cjs/ion-toast.cjs.entry.js +7 -6
  29. package/dist/collection/components/action-sheet/action-sheet.js +12 -11
  30. package/dist/collection/components/alert/alert.js +11 -10
  31. package/dist/collection/components/app/app.js +3 -8
  32. package/dist/collection/components/datetime/datetime.js +8 -23
  33. package/dist/collection/components/loading/loading.js +11 -10
  34. package/dist/collection/components/menu/menu.js +19 -62
  35. package/dist/collection/components/modal/modal.js +16 -35
  36. package/dist/collection/components/popover/popover.js +14 -18
  37. package/dist/collection/components/reorder-group/reorder-group.js +3 -2
  38. package/dist/collection/components/router/router.js +1 -5
  39. package/dist/collection/components/searchbar/searchbar.js +7 -5
  40. package/dist/collection/components/select/select.js +3 -3
  41. package/dist/collection/components/toast/toast.js +10 -9
  42. package/dist/collection/utils/focus-visible.js +18 -27
  43. package/dist/docs.json +72 -138
  44. package/dist/esm/{focus-visible-DZ2gZBzK.js → focus-visible-BmVRXR1y.js} +18 -27
  45. package/dist/esm/ion-action-sheet.entry.js +9 -8
  46. package/dist/esm/ion-alert.entry.js +8 -7
  47. package/dist/esm/ion-app_8.entry.js +2 -4
  48. package/dist/esm/ion-datetime_3.entry.js +3 -9
  49. package/dist/esm/ion-loading.entry.js +8 -7
  50. package/dist/esm/ion-menu_3.entry.js +5 -27
  51. package/dist/esm/ion-modal.entry.js +10 -26
  52. package/dist/esm/ion-popover.entry.js +7 -8
  53. package/dist/esm/ion-reorder_2.entry.js +2 -1
  54. package/dist/esm/ion-route_4.entry.js +0 -1
  55. package/dist/esm/ion-searchbar.entry.js +6 -4
  56. package/dist/esm/ion-select_3.entry.js +3 -3
  57. package/dist/esm/ion-toast.entry.js +7 -6
  58. package/dist/ionic/ionic.esm.js +1 -1
  59. package/dist/ionic/{p-b758a177.entry.js → p-2020aa51.entry.js} +1 -1
  60. package/dist/ionic/p-29759454.entry.js +4 -0
  61. package/dist/ionic/{p-e37d6c67.entry.js → p-3a4feac2.entry.js} +1 -1
  62. package/dist/ionic/p-4ddc10ef.entry.js +4 -0
  63. package/dist/ionic/{p-2d0eccfb.entry.js → p-6b666996.entry.js} +1 -1
  64. package/dist/ionic/p-7149db7e.entry.js +4 -0
  65. package/dist/ionic/{p-2d46fbe7.entry.js → p-96389029.entry.js} +1 -1
  66. package/dist/ionic/{p-0d131a02.entry.js → p-9e699d4a.entry.js} +1 -1
  67. package/dist/ionic/p-BmVRXR1y.js +4 -0
  68. package/dist/ionic/p-bec79123.entry.js +4 -0
  69. package/dist/ionic/{p-03d21728.entry.js → p-cb787a4b.entry.js} +1 -1
  70. package/dist/ionic/{p-d8429eb4.entry.js → p-cd12ed1c.entry.js} +1 -1
  71. package/dist/ionic/{p-78a61b3f.entry.js → p-ead42a37.entry.js} +1 -1
  72. package/dist/types/components/action-sheet/action-sheet.d.ts +6 -5
  73. package/dist/types/components/alert/alert.d.ts +6 -5
  74. package/dist/types/components/app/app.d.ts +0 -2
  75. package/dist/types/components/datetime/datetime.d.ts +0 -6
  76. package/dist/types/components/loading/loading.d.ts +6 -5
  77. package/dist/types/components/menu/menu.d.ts +3 -25
  78. package/dist/types/components/modal/modal.d.ts +6 -14
  79. package/dist/types/components/popover/popover.d.ts +5 -6
  80. package/dist/types/components/reorder-group/reorder-group.d.ts +1 -0
  81. package/dist/types/components/router/router.d.ts +0 -1
  82. package/dist/types/components/searchbar/searchbar.d.ts +2 -0
  83. package/dist/types/components/toast/toast.d.ts +5 -4
  84. package/dist/types/components.d.ts +18 -32
  85. package/hydrate/index.js +86 -136
  86. package/hydrate/index.mjs +86 -136
  87. package/package.json +3 -3
  88. package/dist/ionic/p-69f91268.entry.js +0 -4
  89. package/dist/ionic/p-7d5cf8c1.entry.js +0 -4
  90. package/dist/ionic/p-9e32212d.entry.js +0 -4
  91. package/dist/ionic/p-DZ2gZBzK.js +0 -4
  92. package/dist/ionic/p-b9ba04ca.entry.js +0 -4
@@ -184,17 +184,6 @@ export class Modal {
184
184
  el.dispatchEvent(ev);
185
185
  }
186
186
  };
187
- /**
188
- * When the modal receives focus directly, pass focus to the handle
189
- * if it exists and is focusable, otherwise let the focus trap handle it.
190
- */
191
- this.onModalFocus = (ev) => {
192
- const { dragHandleEl, el } = this;
193
- // Only handle focus if the modal itself was focused (not a child element)
194
- if (ev.target === el && dragHandleEl && dragHandleEl.tabIndex !== -1) {
195
- dragHandleEl.focus();
196
- }
197
- };
198
187
  }
199
188
  onIsOpenChange(newValue, oldValue) {
200
189
  if (newValue === true && oldValue === false) {
@@ -526,13 +515,13 @@ export class Modal {
526
515
  }
527
516
  /**
528
517
  * Dismiss the modal overlay after it has been presented.
518
+ *
519
+ * @param data Any data to emit in the dismiss events.
520
+ * @param role The role of the element that is dismissing the modal. For example, 'cancel' or 'backdrop'.
521
+ *
529
522
  * This is a no-op if the overlay has not been presented yet. If you want
530
523
  * to remove an overlay from the DOM that was never presented, use the
531
524
  * [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
532
- *
533
- * @param data Any data to emit in the dismiss events.
534
- * @param role The role of the element that is dismissing the modal.
535
- * For example, `cancel` or `backdrop`.
536
525
  */
537
526
  async dismiss(data, role) {
538
527
  var _a;
@@ -604,10 +593,8 @@ export class Modal {
604
593
  return eventMethod(this.el, 'ionModalWillDismiss');
605
594
  }
606
595
  /**
607
- * Move a sheet style modal to a specific breakpoint.
608
- *
609
- * @param breakpoint The breakpoint value to move the sheet modal to.
610
- * Must be a value defined in your `breakpoints` array.
596
+ * Move a sheet style modal to a specific breakpoint. The breakpoint value must
597
+ * be a value defined in your `breakpoints` array.
611
598
  */
612
599
  async setCurrentBreakpoint(breakpoint) {
613
600
  if (!this.isSheetModal) {
@@ -666,21 +653,18 @@ export class Modal {
666
653
  const mode = getIonMode(this);
667
654
  const isCardModal = presentingElement !== undefined && mode === 'ios';
668
655
  const isHandleCycle = handleBehavior === 'cycle';
669
- const isSheetModalWithHandle = isSheetModal && showHandle;
670
- return (h(Host, Object.assign({ key: '8add05bb43a2cdb5e3cf180147d31eb85a018fe0', "no-router": true,
671
- // Allow the modal to be navigable when the handle is focusable
672
- tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
656
+ return (h(Host, Object.assign({ key: '0bcbdcfcd7d890eb599da3f97f21c317d34f8e0e', "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
673
657
  zIndex: `${20000 + this.overlayIndex}`,
674
- }, 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: '90a6605a9564a699d6f66cf71cf6b506796a2963', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { key: 'a97d071395333bf803c0a9347bda000cf7500d8d', class: "modal-shadow" }), h("div", Object.assign({ key: 'e7b7985c7414a13e3ba8dcecf497b76e92edf53e',
658
+ }, 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 }), h("ion-backdrop", { key: 'd72159e73daa5af7349aa9e8f695aa435eb43069', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { key: 'fd2d9b13676ae72473881649a397b6eacde03a03', class: "modal-shadow" }), h("div", Object.assign({ key: '908eccb1ad982dcde2dbcff0cbb18b6e60f8ba74',
675
659
  /*
676
660
  role and aria-modal must be used on the
677
661
  same element. They must also be set inside the
678
662
  shadow DOM otherwise ion-button will not be highlighted
679
663
  when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
680
664
  */
681
- role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: '8258b65570b11a8ee9c9df2537d6419cd2e34536', class: "modal-handle",
665
+ role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: '332dc0b40363a77c7be62331d9f26def91c790e9', class: "modal-handle",
682
666
  // Prevents the handle from receiving keyboard focus when it does not cycle
683
- 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: '394370d0ed03ee03152f8f8abae7ff7664ca5c13' }))));
667
+ tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", { key: 'c32698350193c450327e97049daf8b8d1fda0d0e' }))));
684
668
  }
685
669
  static get is() { return "ion-modal"; }
686
670
  static get encapsulation() { return "shadow"; }
@@ -1468,7 +1452,7 @@ export class Modal {
1468
1452
  }, {
1469
1453
  "name": "role",
1470
1454
  "type": "string | undefined",
1471
- "docs": "The role of the element that is dismissing the modal.\nFor example, `cancel` or `backdrop`."
1455
+ "docs": "The role of the element that is dismissing the modal. For example, 'cancel' or 'backdrop'.\n\nThis is a no-op if the overlay has not been presented yet. If you want\nto remove an overlay from the DOM that was never presented, use the\n[remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method."
1472
1456
  }],
1473
1457
  "references": {
1474
1458
  "Promise": {
@@ -1483,13 +1467,13 @@ export class Modal {
1483
1467
  "return": "Promise<boolean>"
1484
1468
  },
1485
1469
  "docs": {
1486
- "text": "Dismiss the modal overlay after it has been presented.\nThis is a no-op if the overlay has not been presented yet. If you want\nto remove an overlay from the DOM that was never presented, use the\n[remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.",
1470
+ "text": "Dismiss the modal overlay after it has been presented.",
1487
1471
  "tags": [{
1488
1472
  "name": "param",
1489
1473
  "text": "data Any data to emit in the dismiss events."
1490
1474
  }, {
1491
1475
  "name": "param",
1492
- "text": "role The role of the element that is dismissing the modal.\nFor example, `cancel` or `backdrop`."
1476
+ "text": "role The role of the element that is dismissing the modal. For example, 'cancel' or 'backdrop'.\n\nThis is a no-op if the overlay has not been presented yet. If you want\nto remove an overlay from the DOM that was never presented, use the\n[remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method."
1493
1477
  }]
1494
1478
  }
1495
1479
  },
@@ -1551,7 +1535,7 @@ export class Modal {
1551
1535
  "parameters": [{
1552
1536
  "name": "breakpoint",
1553
1537
  "type": "number",
1554
- "docs": "The breakpoint value to move the sheet modal to.\nMust be a value defined in your `breakpoints` array."
1538
+ "docs": ""
1555
1539
  }],
1556
1540
  "references": {
1557
1541
  "Promise": {
@@ -1562,11 +1546,8 @@ export class Modal {
1562
1546
  "return": "Promise<void>"
1563
1547
  },
1564
1548
  "docs": {
1565
- "text": "Move a sheet style modal to a specific breakpoint.",
1566
- "tags": [{
1567
- "name": "param",
1568
- "text": "breakpoint The breakpoint value to move the sheet modal to.\nMust be a value defined in your `breakpoints` array."
1569
- }]
1549
+ "text": "Move a sheet style modal to a specific breakpoint. The breakpoint value must\nbe a value defined in your `breakpoints` array.",
1550
+ "tags": []
1570
1551
  }
1571
1552
  },
1572
1553
  "getCurrentBreakpoint": {
@@ -309,8 +309,6 @@ export class Popover {
309
309
  * Developers can pass a mouse, touch, or pointer event
310
310
  * to position the popover relative to where that event
311
311
  * was dispatched.
312
- *
313
- * @param event The event to position the popover relative to.
314
312
  */
315
313
  async present(event) {
316
314
  const unlock = await this.lockController.lock();
@@ -374,14 +372,15 @@ export class Popover {
374
372
  }
375
373
  /**
376
374
  * Dismiss the popover overlay after it has been presented.
377
- * This is a no-op if the overlay has not been presented yet. If you want
378
- * to remove an overlay from the DOM that was never presented, use the
379
- * [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
380
375
  *
381
376
  * @param data Any data to emit in the dismiss events.
382
- * @param role The role of the element that is dismissing the popover. For example, `cancel` or `backdrop`.
377
+ * @param role The role of the element that is dismissing the popover. For example, 'cancel' or 'backdrop'.
383
378
  * @param dismissParentPopover If `true`, dismissing this popover will also dismiss
384
379
  * a parent popover if this popover is nested. Defaults to `true`.
380
+ *
381
+ * This is a no-op if the overlay has not been presented yet. If you want
382
+ * to remove an overlay from the DOM that was never presented, use the
383
+ * [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
385
384
  */
386
385
  async dismiss(data, role, dismissParentPopover = true) {
387
386
  const unlock = await this.lockController.lock();
@@ -433,9 +432,9 @@ export class Popover {
433
432
  const { onLifecycle, parentPopover, dismissOnSelect, side, arrow, htmlAttributes, focusTrap } = this;
434
433
  const desktop = isPlatform('desktop');
435
434
  const enableArrow = arrow && !parentPopover;
436
- return (h(Host, Object.assign({ key: '16866c02534968c982cf4730d2936d03a5107c8b', "aria-modal": "true", "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
435
+ return (h(Host, Object.assign({ key: '1de4862099cfcb5035e78008e6dc7c1371846f9a', "aria-modal": "true", "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
437
436
  zIndex: `${20000 + this.overlayIndex}`,
438
- }, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'popover-translucent': this.translucent, 'overlay-hidden': true, 'popover-desktop': desktop, [`popover-side-${side}`]: true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false, 'popover-nested': !!parentPopover }), onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }), !parentPopover && h("ion-backdrop", { key: '0df258601a4d30df3c27aa8234a7d5e056c3ecbb', tappable: this.backdropDismiss, visible: this.showBackdrop, part: "backdrop" }), h("div", { key: 'f94e80ed996b957b5cd09b826472b4f60e8fcc78', class: "popover-wrapper ion-overlay-wrapper", onClick: dismissOnSelect ? () => this.dismiss() : undefined }, enableArrow && h("div", { key: '185ce22f6386e8444a9cc7b8818dbfc16c463c99', class: "popover-arrow", part: "arrow" }), h("div", { key: '206202b299404e110de5397b229678cca18568d3', class: "popover-content", part: "content" }, h("slot", { key: 'ee543a0b92d6e35a837c0a0e4617c7b0fc4ad0b0' })))));
437
+ }, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'popover-translucent': this.translucent, 'overlay-hidden': true, 'popover-desktop': desktop, [`popover-side-${side}`]: true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false, 'popover-nested': !!parentPopover }), onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }), !parentPopover && h("ion-backdrop", { key: '981aa4e0102cb93312ffbd8243cdf2a0cdc60469', tappable: this.backdropDismiss, visible: this.showBackdrop, part: "backdrop" }), h("div", { key: '1a28ed55e9d34ef78cf0eb0178643301fd2dd75d', class: "popover-wrapper ion-overlay-wrapper", onClick: dismissOnSelect ? () => this.dismiss() : undefined }, enableArrow && h("div", { key: '1c206ea5eb3c0b5883a3d45c34cd22dd5ffe4b65', class: "popover-arrow", part: "arrow" }), h("div", { key: '5ba561486a328c0c7ab825995fdbfb7a196429a4', class: "popover-content", part: "content" }, h("slot", { key: '00fc244ce9dcc2dfc677e6c34b7c8e7a330b2b03' })))));
439
438
  }
440
439
  static get is() { return "ion-popover"; }
441
440
  static get encapsulation() { return "shadow"; }
@@ -1260,7 +1259,7 @@ export class Popover {
1260
1259
  "parameters": [{
1261
1260
  "name": "event",
1262
1261
  "type": "MouseEvent | PointerEvent | TouchEvent | CustomEvent<any> | undefined",
1263
- "docs": "The event to position the popover relative to."
1262
+ "docs": ""
1264
1263
  }],
1265
1264
  "references": {
1266
1265
  "Promise": {
@@ -1292,10 +1291,7 @@ export class Popover {
1292
1291
  },
1293
1292
  "docs": {
1294
1293
  "text": "Present the popover overlay after it has been created.\nDevelopers can pass a mouse, touch, or pointer event\nto position the popover relative to where that event\nwas dispatched.",
1295
- "tags": [{
1296
- "name": "param",
1297
- "text": "event The event to position the popover relative to."
1298
- }]
1294
+ "tags": []
1299
1295
  }
1300
1296
  },
1301
1297
  "dismiss": {
@@ -1308,11 +1304,11 @@ export class Popover {
1308
1304
  }, {
1309
1305
  "name": "role",
1310
1306
  "type": "string | undefined",
1311
- "docs": "The role of the element that is dismissing the popover. For example, `cancel` or `backdrop`."
1307
+ "docs": "The role of the element that is dismissing the popover. For example, 'cancel' or 'backdrop'."
1312
1308
  }, {
1313
1309
  "name": "dismissParentPopover",
1314
1310
  "type": "boolean",
1315
- "docs": "If `true`, dismissing this popover will also dismiss\na parent popover if this popover is nested. Defaults to `true`."
1311
+ "docs": "If `true`, dismissing this popover will also dismiss\na parent popover if this popover is nested. Defaults to `true`.\n\nThis is a no-op if the overlay has not been presented yet. If you want\nto remove an overlay from the DOM that was never presented, use the\n[remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method."
1316
1312
  }],
1317
1313
  "references": {
1318
1314
  "Promise": {
@@ -1327,16 +1323,16 @@ export class Popover {
1327
1323
  "return": "Promise<boolean>"
1328
1324
  },
1329
1325
  "docs": {
1330
- "text": "Dismiss the popover overlay after it has been presented.\nThis is a no-op if the overlay has not been presented yet. If you want\nto remove an overlay from the DOM that was never presented, use the\n[remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.",
1326
+ "text": "Dismiss the popover overlay after it has been presented.",
1331
1327
  "tags": [{
1332
1328
  "name": "param",
1333
1329
  "text": "data Any data to emit in the dismiss events."
1334
1330
  }, {
1335
1331
  "name": "param",
1336
- "text": "role The role of the element that is dismissing the popover. For example, `cancel` or `backdrop`."
1332
+ "text": "role The role of the element that is dismissing the popover. For example, 'cancel' or 'backdrop'."
1337
1333
  }, {
1338
1334
  "name": "param",
1339
- "text": "dismissParentPopover If `true`, dismissing this popover will also dismiss\na parent popover if this popover is nested. Defaults to `true`."
1335
+ "text": "dismissParentPopover If `true`, dismissing this popover will also dismiss\na parent popover if this popover is nested. Defaults to `true`.\n\nThis is a no-op if the overlay has not been presented yet. If you want\nto remove an overlay from the DOM that was never presented, use the\n[remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method."
1340
1336
  }]
1341
1337
  }
1342
1338
  },
@@ -54,6 +54,7 @@ export class ReorderGroup {
54
54
  }
55
55
  /**
56
56
  * Completes the reorder operation. Must be called by the `ionItemReorder` event.
57
+ *
57
58
  * If a list of items is passed, the list will be reordered and returned in the
58
59
  * proper order.
59
60
  *
@@ -240,7 +241,7 @@ export class ReorderGroup {
240
241
  }
241
242
  render() {
242
243
  const mode = getIonMode(this);
243
- return (h(Host, { key: 'dfcdc3a6aa1b2fba15f861ec868d6a11e667c9de', class: {
244
+ return (h(Host, { key: 'f30613b361c5c3095b7928a92fb4b1e8d6eff600', class: {
244
245
  [mode]: true,
245
246
  'reorder-enabled': !this.disabled,
246
247
  'reorder-list-active': this.state !== 0 /* ReorderGroupState.Idle */,
@@ -329,7 +330,7 @@ export class ReorderGroup {
329
330
  "return": "Promise<any>"
330
331
  },
331
332
  "docs": {
332
- "text": "Completes the reorder operation. Must be called by the `ionItemReorder` event.\nIf a list of items is passed, the list will be reordered and returned in the\nproper order.\n\nIf no parameters are passed or if `true` is passed in, the reorder will complete\nand the item will remain in the position it was dragged to. If `false` is passed,\nthe reorder will complete and the item will bounce back to its original position.",
333
+ "text": "Completes the reorder operation. Must be called by the `ionItemReorder` event.\n\nIf a list of items is passed, the list will be reordered and returned in the\nproper order.\n\nIf no parameters are passed or if `true` is passed in, the reorder will complete\nand the item will remain in the position it was dragged to. If `false` is passed,\nthe reorder will complete and the item will bounce back to its original position.",
333
334
  "tags": [{
334
335
  "name": "param",
335
336
  "text": "listOrReorder A list of items to be sorted and returned in the new order or a\nboolean of whether or not the reorder should reposition the item."
@@ -90,7 +90,6 @@ export class Router {
90
90
  *
91
91
  * @param path The path to navigate to.
92
92
  * @param direction The direction of the animation. Defaults to `"forward"`.
93
- * @param animation A custom animation to use for the transition.
94
93
  */
95
94
  async push(path, direction = 'forward', animation) {
96
95
  var _a;
@@ -412,7 +411,7 @@ export class Router {
412
411
  }, {
413
412
  "name": "animation",
414
413
  "type": "AnimationBuilder | undefined",
415
- "docs": "A custom animation to use for the transition."
414
+ "docs": ""
416
415
  }],
417
416
  "references": {
418
417
  "Promise": {
@@ -440,9 +439,6 @@ export class Router {
440
439
  }, {
441
440
  "name": "param",
442
441
  "text": "direction The direction of the animation. Defaults to `\"forward\"`."
443
- }, {
444
- "name": "param",
445
- "text": "animation A custom animation to use for the transition."
446
442
  }]
447
443
  }
448
444
  },
@@ -247,8 +247,10 @@ export class Searchbar {
247
247
  /**
248
248
  * Sets focus on the native `input` in `ion-searchbar`. Use this method instead of the global
249
249
  * `input.focus()`.
250
+ *
250
251
  * Developers who wish to focus an input when a page enters
251
252
  * should call `setFocus()` in the `ionViewDidEnter()` lifecycle method.
253
+ *
252
254
  * Developers who wish to focus an input when an overlay is presented
253
255
  * should call `setFocus` after `didPresent` has resolved.
254
256
  *
@@ -427,8 +429,8 @@ export class Searchbar {
427
429
  const clearIcon = this.clearIcon || (mode === 'ios' ? closeCircle : closeSharp);
428
430
  const searchIcon = this.searchIcon || (mode === 'ios' ? searchOutline : searchSharp);
429
431
  const shouldShowCancelButton = this.shouldShowCancelButton();
430
- const cancelButton = this.showCancelButton !== 'never' && (h("button", { key: '19e18775856db87daeb4b9e3d7bca0461915a0df', "aria-label": cancelButtonText, "aria-hidden": shouldShowCancelButton ? undefined : 'true', type: "button", tabIndex: mode === 'ios' && !shouldShowCancelButton ? -1 : undefined, onMouseDown: this.onCancelSearchbar, onTouchStart: this.onCancelSearchbar, class: "searchbar-cancel-button" }, h("div", { key: 'b3bbdcc033f3bd3441d619e4a252cef0dad4d07e', "aria-hidden": "true" }, mode === 'md' ? (h("ion-icon", { "aria-hidden": "true", mode: mode, icon: this.cancelButtonIcon, lazy: false })) : (cancelButtonText))));
431
- return (h(Host, { key: '074aa60e051bfb3225e87d44bbb6346c59c73574', role: "search", "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses(this.color, {
432
+ const cancelButton = this.showCancelButton !== 'never' && (h("button", { key: '5835c36fcb0b52aec956538202a783f6c194d853', "aria-label": cancelButtonText, "aria-hidden": shouldShowCancelButton ? undefined : 'true', type: "button", tabIndex: mode === 'ios' && !shouldShowCancelButton ? -1 : undefined, onMouseDown: this.onCancelSearchbar, onTouchStart: this.onCancelSearchbar, class: "searchbar-cancel-button" }, h("div", { key: '85df41676bed611467bd4df0002b08baee4f539c', "aria-hidden": "true" }, mode === 'md' ? (h("ion-icon", { "aria-hidden": "true", mode: mode, icon: this.cancelButtonIcon, lazy: false })) : (cancelButtonText))));
433
+ return (h(Host, { key: 'e1e30cdd79f9f54d5f2d27501012358bc46880e5', role: "search", "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses(this.color, {
432
434
  [mode]: true,
433
435
  'searchbar-animated': animated,
434
436
  'searchbar-disabled': this.disabled,
@@ -438,14 +440,14 @@ export class Searchbar {
438
440
  'searchbar-has-focus': this.focused,
439
441
  'searchbar-should-show-clear': this.shouldShowClearButton(),
440
442
  'searchbar-should-show-cancel': this.shouldShowCancelButton(),
441
- }) }, h("div", { key: '54f58a79fe36e85d9295157303f1be89c98bbdaf', class: "searchbar-input-container" }, h("input", Object.assign({ key: 'f991a37fcf54d26b7ad10d89084764e03d97b9de', "aria-label": "search text", disabled: this.disabled, ref: (el) => (this.nativeInput = el), class: "searchbar-input", inputMode: this.inputmode, enterKeyHint: this.enterkeyhint, name: this.name, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, minLength: this.minlength, maxLength: this.maxlength, placeholder: this.placeholder, type: this.type, value: this.getValue(), autoCapitalize: autocapitalize === 'default' ? undefined : autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, spellcheck: this.spellcheck }, this.inheritedAttributes)), mode === 'md' && cancelButton, h("ion-icon", { key: '8b44dd90a3292c5cf872ef16a8520675f5673494', "aria-hidden": "true", mode: mode, icon: searchIcon, lazy: false, class: "searchbar-search-icon" }), h("button", { key: '79d9cfed8f01268044f82811a35d323a12dca749', "aria-label": "reset", type: "button", "no-blur": true, class: "searchbar-clear-button", onPointerDown: (ev) => {
443
+ }) }, h("div", { key: '7e9db147282a35bb1e3c9c6125b9a044e81ddde5', class: "searchbar-input-container" }, h("input", Object.assign({ key: '02f08da21326b78d6cd249d54deab96fd8472ba8', "aria-label": "search text", disabled: this.disabled, ref: (el) => (this.nativeInput = el), class: "searchbar-input", inputMode: this.inputmode, enterKeyHint: this.enterkeyhint, name: this.name, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, minLength: this.minlength, maxLength: this.maxlength, placeholder: this.placeholder, type: this.type, value: this.getValue(), autoCapitalize: autocapitalize === 'default' ? undefined : autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, spellcheck: this.spellcheck }, this.inheritedAttributes)), mode === 'md' && cancelButton, h("ion-icon", { key: '048b00348456bd827ae734491c46a67bfb146227', "aria-hidden": "true", mode: mode, icon: searchIcon, lazy: false, class: "searchbar-search-icon" }), h("button", { key: '71f64339bbfd54ebd26a0946c8ee9d726cd89c04', "aria-label": "reset", type: "button", "no-blur": true, class: "searchbar-clear-button", onPointerDown: (ev) => {
442
444
  /**
443
445
  * This prevents mobile browsers from
444
446
  * blurring the input when the clear
445
447
  * button is activated.
446
448
  */
447
449
  ev.preventDefault();
448
- }, onClick: () => this.onClearInput(true) }, h("ion-icon", { key: 'aa3b9fa8a61f853236783ac7bcd0b113ea65ece2', "aria-hidden": "true", mode: mode, icon: clearIcon, lazy: false, class: "searchbar-clear-icon" }))), mode === 'ios' && cancelButton));
450
+ }, onClick: () => this.onClearInput(true) }, h("ion-icon", { key: '9b1a177b21951c1c95897a468b34bb7bbd63d137', "aria-hidden": "true", mode: mode, icon: clearIcon, lazy: false, class: "searchbar-clear-icon" }))), mode === 'ios' && cancelButton));
449
451
  }
450
452
  static get is() { return "ion-searchbar"; }
451
453
  static get encapsulation() { return "scoped"; }
@@ -1059,7 +1061,7 @@ export class Searchbar {
1059
1061
  "return": "Promise<void>"
1060
1062
  },
1061
1063
  "docs": {
1062
- "text": "Sets focus on the native `input` in `ion-searchbar`. Use this method instead of the global\n`input.focus()`.\nDevelopers who wish to focus an input when a page enters\nshould call `setFocus()` in the `ionViewDidEnter()` lifecycle method.\nDevelopers who wish to focus an input when an overlay is presented\nshould call `setFocus` after `didPresent` has resolved.\n\nSee [managing focus](/docs/developing/managing-focus) for more information.",
1064
+ "text": "Sets focus on the native `input` in `ion-searchbar`. Use this method instead of the global\n`input.focus()`.\n\nDevelopers who wish to focus an input when a page enters\nshould call `setFocus()` in the `ionViewDidEnter()` lifecycle method.\n\nDevelopers who wish to focus an input when an overlay is presented\nshould call `setFocus` after `didPresent` has resolved.\n\nSee [managing focus](/docs/developing/managing-focus) for more information.",
1063
1065
  "tags": []
1064
1066
  }
1065
1067
  },
@@ -216,7 +216,7 @@ export class Select {
216
216
  const scrollSelectedIntoView = () => {
217
217
  const indexOfSelected = this.childOpts.findIndex((o) => o.value === this.value);
218
218
  if (indexOfSelected > -1) {
219
- const selectedItem = overlay.querySelector(`.select-interface-option:nth-of-type(${indexOfSelected + 1})`);
219
+ const selectedItem = overlay.querySelector(`.select-interface-option:nth-child(${indexOfSelected + 1})`);
220
220
  if (selectedItem) {
221
221
  /**
222
222
  * Browsers such as Firefox do not
@@ -782,7 +782,7 @@ export class Select {
782
782
  * TODO(FW-5592): Remove hasStartEndSlots condition
783
783
  */
784
784
  const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
785
- return (h(Host, { key: 'c03fb65e8fc9f9aab295e07b282377d57d910519', onClick: this.onClick, class: createColorClasses(this.color, {
785
+ return (h(Host, { key: 'e33253af9b9daa14460c7c259fb138b4d2b875ae', onClick: this.onClick, class: createColorClasses(this.color, {
786
786
  [mode]: true,
787
787
  'in-item': inItem,
788
788
  'in-item-color': hostContext('ion-item.ion-color', el),
@@ -800,7 +800,7 @@ export class Select {
800
800
  [`select-justify-${justify}`]: justifyEnabled,
801
801
  [`select-shape-${shape}`]: shape !== undefined,
802
802
  [`select-label-placement-${labelPlacement}`]: true,
803
- }) }, h("label", { key: '0d0c8ec55269adcac625f2899a547f4e7f3e3741', class: "select-wrapper", id: "select-label", onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: 'f6dfc93c0e23cbe75a2947abde67d842db2dad78', class: "select-wrapper-inner" }, h("slot", { key: '957bfadf9f101f519091419a362d3abdc2be66f6', name: "start" }), h("div", { key: 'ca349202a484e7f2e884533fd330f0b136754f7d', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), h("slot", { key: 'f0e62a6533ff1c8f62bd2d27f60b23385c4fa9ed', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && h("div", { key: 'fb840d46bafafb09898ebeebbe8c181906a3d8a2', class: "select-highlight" })), this.renderBottomContent()));
803
+ }) }, h("label", { key: '03303b7131c77a78a933e8e496e7251b6b5c485b', class: "select-wrapper", id: "select-label", onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: '9037674db6a0adc189e887c9048f817d5afdf635', class: "select-wrapper-inner" }, h("slot", { key: '7c9226c838ba4bcf5bc0b234fa1613ce335cf73d', name: "start" }), h("div", { key: 'a7432c3efb5c65f88a5e4b0d35c5a433fa4e949d', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), h("slot", { key: '028e683df26a8f573d7670da76e0ad26d21c83e0', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && h("div", { key: '20341bcae3753048ce905d2aceffa5351a0db125', class: "select-highlight" })), this.renderBottomContent()));
804
804
  }
805
805
  static get is() { return "ion-select"; }
806
806
  static get encapsulation() { return "shadow"; }
@@ -239,15 +239,16 @@ export class Toast {
239
239
  }
240
240
  /**
241
241
  * Dismiss the toast overlay after it has been presented.
242
- * This is a no-op if the overlay has not been presented yet. If you want
243
- * to remove an overlay from the DOM that was never presented, use the
244
- * [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
245
242
  *
246
243
  * @param data Any data to emit in the dismiss events.
247
244
  * @param role The role of the element that is dismissing the toast.
248
245
  * This can be useful in a button handler for determining which button was
249
246
  * clicked to dismiss the toast.
250
- * Some examples include: `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
247
+ * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
248
+ *
249
+ * This is a no-op if the overlay has not been presented yet. If you want
250
+ * to remove an overlay from the DOM that was never presented, use the
251
+ * [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
251
252
  */
252
253
  async dismiss(data, role) {
253
254
  var _a, _b;
@@ -415,9 +416,9 @@ export class Toast {
415
416
  if (layout === 'stacked' && startButtons.length > 0 && endButtons.length > 0) {
416
417
  printIonWarning('[ion-toast] - This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.', el);
417
418
  }
418
- return (h(Host, Object.assign({ key: 'd1ecd90c87700aad4685e230cdd430aa286b8791', tabindex: "-1" }, this.htmlAttributes, { style: {
419
+ return (h(Host, Object.assign({ key: '425be734aee0eeef281ab1609a9f982ce8b5e852', tabindex: "-1" }, this.htmlAttributes, { style: {
419
420
  zIndex: `${60000 + this.overlayIndex}`,
420
- }, class: createColorClasses(this.color, Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'toast-translucent': this.translucent })), onIonToastWillDismiss: this.dispatchCancelHandler }), h("div", { key: '4bfc863417324de69e222054d5cf9c452038b41e', class: wrapperClass }, h("div", { key: '3417940afec0392e81b7d54c7cb00f3ab6c30d47', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (h("ion-icon", { key: '6bf878fbc85c01e1e5faa9d97d46255a6511a952', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), h("div", { key: '54b500348a9c37660c3aff37436d9188e4374947', class: "toast-content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
421
+ }, class: createColorClasses(this.color, Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'toast-translucent': this.translucent })), onIonToastWillDismiss: this.dispatchCancelHandler }), h("div", { key: '7c3ad1a8df9e21fc30fc179c7edebeabcf3c6874', class: wrapperClass }, h("div", { key: 'f950c21e8d7bf92653e0bd52e820ed6b84fa8cf5', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (h("ion-icon", { key: '0266241927dbe16799adb57f9fc11bd5372877b2', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), h("div", { key: '9ef4b87bad672af6a5b693af61375564daf1eeeb', class: "toast-content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
421
422
  }
422
423
  static get is() { return "ion-toast"; }
423
424
  static get encapsulation() { return "shadow"; }
@@ -1112,7 +1113,7 @@ export class Toast {
1112
1113
  }, {
1113
1114
  "name": "role",
1114
1115
  "type": "string | undefined",
1115
- "docs": "The role of the element that is dismissing the toast.\nThis can be useful in a button handler for determining which button was\nclicked to dismiss the toast.\nSome examples include: `\"cancel\"`, `\"destructive\"`, `\"selected\"`, and `\"backdrop\"`."
1116
+ "docs": "The role of the element that is dismissing the toast.\nThis can be useful in a button handler for determining which button was\nclicked to dismiss the toast.\nSome examples include: ``\"cancel\"`, `\"destructive\"`, \"selected\"`, and `\"backdrop\"`.\n\nThis is a no-op if the overlay has not been presented yet. If you want\nto remove an overlay from the DOM that was never presented, use the\n[remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method."
1116
1117
  }],
1117
1118
  "references": {
1118
1119
  "Promise": {
@@ -1128,13 +1129,13 @@ export class Toast {
1128
1129
  "return": "Promise<boolean>"
1129
1130
  },
1130
1131
  "docs": {
1131
- "text": "Dismiss the toast overlay after it has been presented.\nThis is a no-op if the overlay has not been presented yet. If you want\nto remove an overlay from the DOM that was never presented, use the\n[remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.",
1132
+ "text": "Dismiss the toast overlay after it has been presented.",
1132
1133
  "tags": [{
1133
1134
  "name": "param",
1134
1135
  "text": "data Any data to emit in the dismiss events."
1135
1136
  }, {
1136
1137
  "name": "param",
1137
- "text": "role The role of the element that is dismissing the toast.\nThis can be useful in a button handler for determining which button was\nclicked to dismiss the toast.\nSome examples include: `\"cancel\"`, `\"destructive\"`, `\"selected\"`, and `\"backdrop\"`."
1138
+ "text": "role The role of the element that is dismissing the toast.\nThis can be useful in a button handler for determining which button was\nclicked to dismiss the toast.\nSome examples include: ``\"cancel\"`, `\"destructive\"`, \"selected\"`, and `\"backdrop\"`.\n\nThis is a no-op if the overlay has not been presented yet. If you want\nto remove an overlay from the DOM that was never presented, use the\n[remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method."
1138
1139
  }]
1139
1140
  }
1140
1141
  },
@@ -19,44 +19,33 @@ const FOCUS_KEYS = [
19
19
  ];
20
20
  export const startFocusVisible = (rootEl) => {
21
21
  let currentFocus = [];
22
- // Tracks if the last interaction was a pointer event (mouse, touch, pen)
23
- // Used to distinguish between pointer and keyboard navigation for focus styling
24
- let hadPointerEvent = false;
22
+ let keyboardMode = true;
25
23
  const ref = rootEl ? rootEl.shadowRoot : document;
26
24
  const root = rootEl ? rootEl : document.body;
27
- // Adds or removes the focused class for styling
28
25
  const setFocus = (elements) => {
29
26
  currentFocus.forEach((el) => el.classList.remove(ION_FOCUSED));
30
27
  elements.forEach((el) => el.classList.add(ION_FOCUSED));
31
28
  currentFocus = elements;
32
29
  };
33
- // Do not set focus on pointer interactions
34
- const pointerDown = (ev) => {
35
- if (ev instanceof PointerEvent && ev.pointerType !== '') {
36
- hadPointerEvent = true;
37
- // Reset after the event loop so only the immediate focusin is suppressed
38
- setTimeout(() => {
39
- hadPointerEvent = false;
40
- }, 0);
41
- }
30
+ const pointerDown = () => {
31
+ keyboardMode = false;
32
+ setFocus([]);
42
33
  };
43
- // Clear hadPointerEvent so keyboard navigation shows focus
44
- // Also, clear focus if the key is not a navigation key
45
34
  const onKeydown = (ev) => {
46
- hadPointerEvent = false;
47
- const keyboardEvent = ev;
48
- if (!FOCUS_KEYS.includes(keyboardEvent.key)) {
35
+ keyboardMode = FOCUS_KEYS.includes(ev.key);
36
+ if (!keyboardMode) {
49
37
  setFocus([]);
50
38
  }
51
39
  };
52
- // Set focus if the last interaction was NOT a pointer event
53
- // This works around iOS/Safari bugs where keydown is not fired for Tab
54
40
  const onFocusin = (ev) => {
55
- const target = ev.target;
56
- if (target.classList.contains(ION_FOCUSABLE) && !hadPointerEvent) {
57
- const toFocus = ev
58
- .composedPath()
59
- .filter((el) => el instanceof HTMLElement && el.classList.contains(ION_FOCUSABLE));
41
+ if (keyboardMode && ev.composedPath !== undefined) {
42
+ const toFocus = ev.composedPath().filter((el) => {
43
+ // TODO(FW-2832): type
44
+ if (el.classList) {
45
+ return el.classList.contains(ION_FOCUSABLE);
46
+ }
47
+ return false;
48
+ });
60
49
  setFocus(toFocus);
61
50
  }
62
51
  };
@@ -68,12 +57,14 @@ export const startFocusVisible = (rootEl) => {
68
57
  ref.addEventListener('keydown', onKeydown);
69
58
  ref.addEventListener('focusin', onFocusin);
70
59
  ref.addEventListener('focusout', onFocusout);
71
- ref.addEventListener('pointerdown', pointerDown, { passive: true });
60
+ ref.addEventListener('touchstart', pointerDown, { passive: true });
61
+ ref.addEventListener('mousedown', pointerDown);
72
62
  const destroy = () => {
73
63
  ref.removeEventListener('keydown', onKeydown);
74
64
  ref.removeEventListener('focusin', onFocusin);
75
65
  ref.removeEventListener('focusout', onFocusout);
76
- ref.removeEventListener('pointerdown', pointerDown);
66
+ ref.removeEventListener('touchstart', pointerDown);
67
+ ref.removeEventListener('mousedown', pointerDown);
77
68
  };
78
69
  return {
79
70
  destroy,