@ionic/core 7.7.2-nightly.20240209 → 7.7.2-nightly.20240212
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.
- package/components/overlays.js +25 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/ion-alert.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-toast.cjs.entry.js +1 -1
- package/dist/cjs/{overlays-c0b199e9.js → overlays-853fbc2a.js} +25 -1
- package/dist/collection/utils/overlays.js +25 -1
- package/dist/collection/utils/test/overlays/overlays.spec.js +51 -0
- package/dist/docs.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +1 -1
- package/dist/esm/ion-alert.entry.js +1 -1
- package/dist/esm/ion-datetime_3.entry.js +1 -1
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +1 -1
- package/dist/esm/{overlays-141e4a0f.js → overlays-f628ea0d.js} +25 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
- package/dist/esm-es5/ion-alert.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-loading.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/overlays-f628ea0d.js +4 -0
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-2f30744e.system.entry.js → p-02228941.system.entry.js} +1 -1
- package/dist/ionic/{p-77b5178b.system.entry.js → p-03ef11fd.system.entry.js} +1 -1
- package/dist/ionic/p-33c1d796.system.js +1 -1
- package/dist/ionic/{p-00feeece.entry.js → p-36129d85.entry.js} +1 -1
- package/dist/ionic/{p-8964db8b.entry.js → p-379dc0d8.entry.js} +1 -1
- package/dist/ionic/{p-b2189b67.system.entry.js → p-3996f9d5.system.entry.js} +2 -2
- package/dist/ionic/p-554cdfa6.js +4 -0
- package/dist/ionic/{p-c65399ff.system.entry.js → p-6b5ddd6f.system.entry.js} +1 -1
- package/dist/ionic/{p-34c60592.system.entry.js → p-6c03fe3f.system.entry.js} +1 -1
- package/dist/ionic/{p-3eb54fff.system.entry.js → p-779fb2ab.system.entry.js} +1 -1
- package/dist/ionic/{p-3b2e1fad.system.entry.js → p-7b71daed.system.entry.js} +1 -1
- package/dist/ionic/{p-72e6fbe3.entry.js → p-80c7dd10.entry.js} +1 -1
- package/dist/ionic/{p-59b06910.entry.js → p-9e986623.entry.js} +1 -1
- package/dist/ionic/{p-4edfddd3.entry.js → p-a06dd73e.entry.js} +1 -1
- package/dist/ionic/{p-08f50365.entry.js → p-a726c887.entry.js} +1 -1
- package/dist/ionic/{p-389a681c.entry.js → p-a9de90a5.entry.js} +1 -1
- package/dist/ionic/{p-0c2363a9.system.js → p-b964aaa3.system.js} +1 -1
- package/dist/ionic/{p-caedbb0e.entry.js → p-c05246a7.entry.js} +1 -1
- package/dist/ionic/{p-62ea79fb.system.js → p-c2895673.system.js} +1 -1
- package/dist/ionic/{p-e7b4f81d.entry.js → p-c98011a7.entry.js} +1 -1
- package/dist/ionic/{p-f7981b54.system.entry.js → p-d51bf7d0.system.entry.js} +1 -1
- package/dist/ionic/{p-e02b2365.system.entry.js → p-e49bc381.system.entry.js} +1 -1
- package/hydrate/index.js +25 -1
- package/package.json +1 -1
- package/dist/esm-es5/overlays-141e4a0f.js +0 -4
- package/dist/ionic/p-7888a87b.js +0 -4
package/components/overlays.js
CHANGED
|
@@ -408,6 +408,15 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
408
408
|
return;
|
|
409
409
|
}
|
|
410
410
|
setRootAriaHidden(true);
|
|
411
|
+
/**
|
|
412
|
+
* Hide all other overlays from screen readers so only this one
|
|
413
|
+
* can be read. Note that presenting an overlay always makes
|
|
414
|
+
* it the topmost one.
|
|
415
|
+
*/
|
|
416
|
+
if (doc !== undefined) {
|
|
417
|
+
const presentedOverlays = getPresentedOverlays(doc);
|
|
418
|
+
presentedOverlays.forEach((o) => o.setAttribute('aria-hidden', 'true'));
|
|
419
|
+
}
|
|
411
420
|
overlay.presented = true;
|
|
412
421
|
overlay.willPresent.emit();
|
|
413
422
|
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
@@ -441,6 +450,14 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
441
450
|
if (overlay.keyboardClose && (document.activeElement === null || !overlay.el.contains(document.activeElement))) {
|
|
442
451
|
overlay.el.focus();
|
|
443
452
|
}
|
|
453
|
+
/**
|
|
454
|
+
* If this overlay was previously dismissed without being
|
|
455
|
+
* the topmost one (such as by manually calling dismiss()),
|
|
456
|
+
* it would still have aria-hidden on being presented again.
|
|
457
|
+
* Removing it here ensures the overlay is visible to screen
|
|
458
|
+
* readers.
|
|
459
|
+
*/
|
|
460
|
+
overlay.el.removeAttribute('aria-hidden');
|
|
444
461
|
};
|
|
445
462
|
/**
|
|
446
463
|
* When an overlay component is dismissed,
|
|
@@ -466,7 +483,7 @@ const focusPreviousElementOnDismiss = async (overlayEl) => {
|
|
|
466
483
|
previousElement.focus();
|
|
467
484
|
};
|
|
468
485
|
const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnimation, opts) => {
|
|
469
|
-
var _a, _b;
|
|
486
|
+
var _a, _b, _c;
|
|
470
487
|
if (!overlay.presented) {
|
|
471
488
|
return false;
|
|
472
489
|
}
|
|
@@ -517,6 +534,13 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
517
534
|
console.error(err);
|
|
518
535
|
}
|
|
519
536
|
overlay.el.remove();
|
|
537
|
+
/**
|
|
538
|
+
* If there are other overlays presented, unhide the new
|
|
539
|
+
* topmost one from screen readers.
|
|
540
|
+
*/
|
|
541
|
+
if (doc !== undefined) {
|
|
542
|
+
(_c = getPresentedOverlay(doc)) === null || _c === void 0 ? void 0 : _c.removeAttribute('aria-hidden');
|
|
543
|
+
}
|
|
520
544
|
return true;
|
|
521
545
|
};
|
|
522
546
|
const getAppRoot = (doc) => {
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -16,7 +16,7 @@ const helpers = require('./helpers-2e1028fa.js');
|
|
|
16
16
|
const config = require('./config-4f60b98a.js');
|
|
17
17
|
const theme = require('./theme-d1c573d2.js');
|
|
18
18
|
const index$2 = require('./index-a43f7a0f.js');
|
|
19
|
-
const overlays = require('./overlays-
|
|
19
|
+
const overlays = require('./overlays-853fbc2a.js');
|
|
20
20
|
require('./index-c8d52405.js');
|
|
21
21
|
require('./index-0ffe376d.js');
|
|
22
22
|
require('./gesture-controller-c40c045a.js');
|
|
@@ -9,7 +9,7 @@ const index = require('./index-0ffe376d.js');
|
|
|
9
9
|
const buttonActive = require('./button-active-2d6520ec.js');
|
|
10
10
|
const helpers = require('./helpers-2e1028fa.js');
|
|
11
11
|
const lockController = require('./lock-controller-6585a42a.js');
|
|
12
|
-
const overlays = require('./overlays-
|
|
12
|
+
const overlays = require('./overlays-853fbc2a.js');
|
|
13
13
|
const theme = require('./theme-d1c573d2.js');
|
|
14
14
|
const ionicGlobal = require('./ionic-global-59a10130.js');
|
|
15
15
|
const animation = require('./animation-fdab9de5.js');
|
|
@@ -10,7 +10,7 @@ const config = require('./config-4f60b98a.js');
|
|
|
10
10
|
const buttonActive = require('./button-active-2d6520ec.js');
|
|
11
11
|
const helpers = require('./helpers-2e1028fa.js');
|
|
12
12
|
const lockController = require('./lock-controller-6585a42a.js');
|
|
13
|
-
const overlays = require('./overlays-
|
|
13
|
+
const overlays = require('./overlays-853fbc2a.js');
|
|
14
14
|
const theme = require('./theme-d1c573d2.js');
|
|
15
15
|
const ionicGlobal = require('./ionic-global-59a10130.js');
|
|
16
16
|
const animation = require('./animation-fdab9de5.js');
|
|
@@ -15,7 +15,7 @@ const index$2 = require('./index-f52c6d38.js');
|
|
|
15
15
|
const ionicGlobal = require('./ionic-global-59a10130.js');
|
|
16
16
|
const data = require('./data-a5109f09.js');
|
|
17
17
|
const lockController = require('./lock-controller-6585a42a.js');
|
|
18
|
-
const overlays = require('./overlays-
|
|
18
|
+
const overlays = require('./overlays-853fbc2a.js');
|
|
19
19
|
const animation = require('./animation-fdab9de5.js');
|
|
20
20
|
const haptic = require('./haptic-b882e0bb.js');
|
|
21
21
|
require('./index-c8d52405.js');
|
|
@@ -9,7 +9,7 @@ const index = require('./index-0ffe376d.js');
|
|
|
9
9
|
const config = require('./config-4f60b98a.js');
|
|
10
10
|
const helpers = require('./helpers-2e1028fa.js');
|
|
11
11
|
const lockController = require('./lock-controller-6585a42a.js');
|
|
12
|
-
const overlays = require('./overlays-
|
|
12
|
+
const overlays = require('./overlays-853fbc2a.js');
|
|
13
13
|
const theme = require('./theme-d1c573d2.js');
|
|
14
14
|
const ionicGlobal = require('./ionic-global-59a10130.js');
|
|
15
15
|
const animation = require('./animation-fdab9de5.js');
|
|
@@ -11,7 +11,7 @@ const gestureController = require('./gesture-controller-c40c045a.js');
|
|
|
11
11
|
const hardwareBackButton = require('./hardware-back-button-2696acaf.js');
|
|
12
12
|
const helpers = require('./helpers-2e1028fa.js');
|
|
13
13
|
const index$1 = require('./index-a43f7a0f.js');
|
|
14
|
-
const overlays = require('./overlays-
|
|
14
|
+
const overlays = require('./overlays-853fbc2a.js');
|
|
15
15
|
const ionicGlobal = require('./ionic-global-59a10130.js');
|
|
16
16
|
const theme = require('./theme-d1c573d2.js');
|
|
17
17
|
const index$2 = require('./index-f52c6d38.js');
|
|
@@ -12,7 +12,7 @@ const helpers = require('./helpers-2e1028fa.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-
|
|
15
|
+
const overlays = require('./overlays-853fbc2a.js');
|
|
16
16
|
const theme = require('./theme-d1c573d2.js');
|
|
17
17
|
const index$5 = require('./index-c3580a90.js');
|
|
18
18
|
const ionicGlobal = require('./ionic-global-59a10130.js');
|
|
@@ -10,7 +10,7 @@ const frameworkDelegate = require('./framework-delegate-a3e6d060.js');
|
|
|
10
10
|
const helpers = require('./helpers-2e1028fa.js');
|
|
11
11
|
const lockController = require('./lock-controller-6585a42a.js');
|
|
12
12
|
const index$1 = require('./index-5915f9b3.js');
|
|
13
|
-
const overlays = require('./overlays-
|
|
13
|
+
const overlays = require('./overlays-853fbc2a.js');
|
|
14
14
|
const ionicGlobal = require('./ionic-global-59a10130.js');
|
|
15
15
|
const theme = require('./theme-d1c573d2.js');
|
|
16
16
|
const index$2 = require('./index-c3580a90.js');
|
|
@@ -11,7 +11,7 @@ const notchController = require('./notch-controller-db0127c4.js');
|
|
|
11
11
|
const compareWithUtils = require('./compare-with-utils-df1001d7.js');
|
|
12
12
|
const helpers = require('./helpers-2e1028fa.js');
|
|
13
13
|
const index$1 = require('./index-5915f9b3.js');
|
|
14
|
-
const overlays = require('./overlays-
|
|
14
|
+
const overlays = require('./overlays-853fbc2a.js');
|
|
15
15
|
const dir = require('./dir-94c21456.js');
|
|
16
16
|
const theme = require('./theme-d1c573d2.js');
|
|
17
17
|
const watchOptions = require('./watch-options-f5f3e158.js');
|
|
@@ -10,7 +10,7 @@ const config = require('./config-4f60b98a.js');
|
|
|
10
10
|
const helpers = require('./helpers-2e1028fa.js');
|
|
11
11
|
const lockController = require('./lock-controller-6585a42a.js');
|
|
12
12
|
const index$1 = require('./index-5915f9b3.js');
|
|
13
|
-
const overlays = require('./overlays-
|
|
13
|
+
const overlays = require('./overlays-853fbc2a.js');
|
|
14
14
|
const theme = require('./theme-d1c573d2.js');
|
|
15
15
|
const ionicGlobal = require('./ionic-global-59a10130.js');
|
|
16
16
|
const animation = require('./animation-fdab9de5.js');
|
|
@@ -410,6 +410,15 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
410
410
|
return;
|
|
411
411
|
}
|
|
412
412
|
setRootAriaHidden(true);
|
|
413
|
+
/**
|
|
414
|
+
* Hide all other overlays from screen readers so only this one
|
|
415
|
+
* can be read. Note that presenting an overlay always makes
|
|
416
|
+
* it the topmost one.
|
|
417
|
+
*/
|
|
418
|
+
if (index.doc !== undefined) {
|
|
419
|
+
const presentedOverlays = getPresentedOverlays(index.doc);
|
|
420
|
+
presentedOverlays.forEach((o) => o.setAttribute('aria-hidden', 'true'));
|
|
421
|
+
}
|
|
413
422
|
overlay.presented = true;
|
|
414
423
|
overlay.willPresent.emit();
|
|
415
424
|
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
@@ -443,6 +452,14 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
443
452
|
if (overlay.keyboardClose && (document.activeElement === null || !overlay.el.contains(document.activeElement))) {
|
|
444
453
|
overlay.el.focus();
|
|
445
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* If this overlay was previously dismissed without being
|
|
457
|
+
* the topmost one (such as by manually calling dismiss()),
|
|
458
|
+
* it would still have aria-hidden on being presented again.
|
|
459
|
+
* Removing it here ensures the overlay is visible to screen
|
|
460
|
+
* readers.
|
|
461
|
+
*/
|
|
462
|
+
overlay.el.removeAttribute('aria-hidden');
|
|
446
463
|
};
|
|
447
464
|
/**
|
|
448
465
|
* When an overlay component is dismissed,
|
|
@@ -468,7 +485,7 @@ const focusPreviousElementOnDismiss = async (overlayEl) => {
|
|
|
468
485
|
previousElement.focus();
|
|
469
486
|
};
|
|
470
487
|
const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnimation, opts) => {
|
|
471
|
-
var _a, _b;
|
|
488
|
+
var _a, _b, _c;
|
|
472
489
|
if (!overlay.presented) {
|
|
473
490
|
return false;
|
|
474
491
|
}
|
|
@@ -519,6 +536,13 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
519
536
|
console.error(err);
|
|
520
537
|
}
|
|
521
538
|
overlay.el.remove();
|
|
539
|
+
/**
|
|
540
|
+
* If there are other overlays presented, unhide the new
|
|
541
|
+
* topmost one from screen readers.
|
|
542
|
+
*/
|
|
543
|
+
if (index.doc !== undefined) {
|
|
544
|
+
(_c = getPresentedOverlay(index.doc)) === null || _c === void 0 ? void 0 : _c.removeAttribute('aria-hidden');
|
|
545
|
+
}
|
|
522
546
|
return true;
|
|
523
547
|
};
|
|
524
548
|
const getAppRoot = (doc) => {
|
|
@@ -409,6 +409,15 @@ export const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation
|
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
411
|
setRootAriaHidden(true);
|
|
412
|
+
/**
|
|
413
|
+
* Hide all other overlays from screen readers so only this one
|
|
414
|
+
* can be read. Note that presenting an overlay always makes
|
|
415
|
+
* it the topmost one.
|
|
416
|
+
*/
|
|
417
|
+
if (doc !== undefined) {
|
|
418
|
+
const presentedOverlays = getPresentedOverlays(doc);
|
|
419
|
+
presentedOverlays.forEach((o) => o.setAttribute('aria-hidden', 'true'));
|
|
420
|
+
}
|
|
412
421
|
overlay.presented = true;
|
|
413
422
|
overlay.willPresent.emit();
|
|
414
423
|
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
@@ -442,6 +451,14 @@ export const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation
|
|
|
442
451
|
if (overlay.keyboardClose && (document.activeElement === null || !overlay.el.contains(document.activeElement))) {
|
|
443
452
|
overlay.el.focus();
|
|
444
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* If this overlay was previously dismissed without being
|
|
456
|
+
* the topmost one (such as by manually calling dismiss()),
|
|
457
|
+
* it would still have aria-hidden on being presented again.
|
|
458
|
+
* Removing it here ensures the overlay is visible to screen
|
|
459
|
+
* readers.
|
|
460
|
+
*/
|
|
461
|
+
overlay.el.removeAttribute('aria-hidden');
|
|
445
462
|
};
|
|
446
463
|
/**
|
|
447
464
|
* When an overlay component is dismissed,
|
|
@@ -467,7 +484,7 @@ const focusPreviousElementOnDismiss = async (overlayEl) => {
|
|
|
467
484
|
previousElement.focus();
|
|
468
485
|
};
|
|
469
486
|
export const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnimation, opts) => {
|
|
470
|
-
var _a, _b;
|
|
487
|
+
var _a, _b, _c;
|
|
471
488
|
if (!overlay.presented) {
|
|
472
489
|
return false;
|
|
473
490
|
}
|
|
@@ -518,6 +535,13 @@ export const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLe
|
|
|
518
535
|
console.error(err);
|
|
519
536
|
}
|
|
520
537
|
overlay.el.remove();
|
|
538
|
+
/**
|
|
539
|
+
* If there are other overlays presented, unhide the new
|
|
540
|
+
* topmost one from screen readers.
|
|
541
|
+
*/
|
|
542
|
+
if (doc !== undefined) {
|
|
543
|
+
(_c = getPresentedOverlay(doc)) === null || _c === void 0 ? void 0 : _c.removeAttribute('aria-hidden');
|
|
544
|
+
}
|
|
521
545
|
return true;
|
|
522
546
|
};
|
|
523
547
|
const getAppRoot = (doc) => {
|
|
@@ -100,3 +100,54 @@ describe('setRootAriaHidden()', () => {
|
|
|
100
100
|
expect(routerOutlet.hasAttribute('aria-hidden')).toEqual(false);
|
|
101
101
|
});
|
|
102
102
|
});
|
|
103
|
+
describe('aria-hidden on individual overlays', () => {
|
|
104
|
+
it('should hide non-topmost overlays from screen readers', async () => {
|
|
105
|
+
const page = await newSpecPage({
|
|
106
|
+
components: [Modal],
|
|
107
|
+
html: `
|
|
108
|
+
<ion-modal id="one"></ion-modal>
|
|
109
|
+
<ion-modal id="two"></ion-modal>
|
|
110
|
+
`,
|
|
111
|
+
});
|
|
112
|
+
const modalOne = page.body.querySelector('ion-modal#one');
|
|
113
|
+
const modalTwo = page.body.querySelector('ion-modal#two');
|
|
114
|
+
await modalOne.present();
|
|
115
|
+
await modalTwo.present();
|
|
116
|
+
expect(modalOne.hasAttribute('aria-hidden')).toEqual(true);
|
|
117
|
+
expect(modalTwo.hasAttribute('aria-hidden')).toEqual(false);
|
|
118
|
+
});
|
|
119
|
+
it('should unhide new topmost overlay from screen readers when topmost is dismissed', async () => {
|
|
120
|
+
const page = await newSpecPage({
|
|
121
|
+
components: [Modal],
|
|
122
|
+
html: `
|
|
123
|
+
<ion-modal id="one"></ion-modal>
|
|
124
|
+
<ion-modal id="two"></ion-modal>
|
|
125
|
+
`,
|
|
126
|
+
});
|
|
127
|
+
const modalOne = page.body.querySelector('ion-modal#one');
|
|
128
|
+
const modalTwo = page.body.querySelector('ion-modal#two');
|
|
129
|
+
await modalOne.present();
|
|
130
|
+
await modalTwo.present();
|
|
131
|
+
// dismiss modalTwo so that modalOne becomes the new topmost overlay
|
|
132
|
+
await modalTwo.dismiss();
|
|
133
|
+
expect(modalOne.hasAttribute('aria-hidden')).toEqual(false);
|
|
134
|
+
});
|
|
135
|
+
it('should not keep overlays hidden from screen readers if presented after being dismissed while non-topmost', async () => {
|
|
136
|
+
const page = await newSpecPage({
|
|
137
|
+
components: [Modal],
|
|
138
|
+
html: `
|
|
139
|
+
<ion-modal id="one"></ion-modal>
|
|
140
|
+
<ion-modal id="two"></ion-modal>
|
|
141
|
+
`,
|
|
142
|
+
});
|
|
143
|
+
const modalOne = page.body.querySelector('ion-modal#one');
|
|
144
|
+
const modalTwo = page.body.querySelector('ion-modal#two');
|
|
145
|
+
await modalOne.present();
|
|
146
|
+
await modalTwo.present();
|
|
147
|
+
// modalOne is not the topmost overlay at this point and is hidden from screen readers
|
|
148
|
+
await modalOne.dismiss();
|
|
149
|
+
// modalOne will become the topmost overlay; ensure it isn't still hidden from screen readers
|
|
150
|
+
await modalOne.present();
|
|
151
|
+
expect(modalOne.hasAttribute('aria-hidden')).toEqual(false);
|
|
152
|
+
});
|
|
153
|
+
});
|
package/dist/docs.json
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export { c as componentOnReady } from './helpers-c0b9ca37.js';
|
|
|
12
12
|
export { I as IonicSafeString, g as getMode, s as setupConfig } from './config-49c88215.js';
|
|
13
13
|
export { o as openURL } from './theme-01f3f29c.js';
|
|
14
14
|
export { m as menuController } from './index-47b2066d.js';
|
|
15
|
-
export { b as actionSheetController, a as alertController, l as loadingController, m as modalController, p as pickerController, c as popoverController, t as toastController } from './overlays-
|
|
15
|
+
export { b as actionSheetController, a as alertController, l as loadingController, m as modalController, p as pickerController, c as popoverController, t as toastController } from './overlays-f628ea0d.js';
|
|
16
16
|
import './index-a5d50daf.js';
|
|
17
17
|
import './index-4c30cddd.js';
|
|
18
18
|
import './gesture-controller-1bf57181.js';
|
|
@@ -5,7 +5,7 @@ import { r as registerInstance, d as createEvent, e as readTask, h, H as Host, f
|
|
|
5
5
|
import { c as createButtonActiveGesture } from './button-active-47ac8092.js';
|
|
6
6
|
import { r as raf } from './helpers-c0b9ca37.js';
|
|
7
7
|
import { c as createLockController } from './lock-controller-316928be.js';
|
|
8
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, f as present, g as dismiss, h as eventMethod, s as safeCall, j as prepareOverlay, k as setOverlayId } from './overlays-
|
|
8
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, f as present, g as dismiss, h as eventMethod, s as safeCall, j as prepareOverlay, k as setOverlayId } from './overlays-f628ea0d.js';
|
|
9
9
|
import { g as getClassMap } from './theme-01f3f29c.js';
|
|
10
10
|
import { b as getIonMode } from './ionic-global-ad9a1810.js';
|
|
11
11
|
import { c as createAnimation } from './animation-60dbdd13.js';
|
|
@@ -6,7 +6,7 @@ import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './conf
|
|
|
6
6
|
import { c as createButtonActiveGesture } from './button-active-47ac8092.js';
|
|
7
7
|
import { r as raf } from './helpers-c0b9ca37.js';
|
|
8
8
|
import { c as createLockController } from './lock-controller-316928be.js';
|
|
9
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-
|
|
9
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-f628ea0d.js';
|
|
10
10
|
import { g as getClassMap } from './theme-01f3f29c.js';
|
|
11
11
|
import { c as config, b as getIonMode } from './ionic-global-ad9a1810.js';
|
|
12
12
|
import { c as createAnimation } from './animation-60dbdd13.js';
|
|
@@ -11,7 +11,7 @@ import { c as chevronBack, o as chevronForward, l as chevronDown, p as caretUpSh
|
|
|
11
11
|
import { b as getIonMode } from './ionic-global-ad9a1810.js';
|
|
12
12
|
import { g as generateDayAriaLabel, a as getDay, i as isBefore, b as isAfter, c as isSameDay, d as getPreviousMonth, e as getNextMonth, v as validateParts, f as getPartsFromCalendarDay, h as getNextYear, j as getPreviousYear, k as getEndOfWeek, l as getStartOfWeek, m as getPreviousDay, n as getNextDay, o as getPreviousWeek, p as getNextWeek, q as parseMinParts, r as parseMaxParts, s as parseDate, w as warnIfValueOutOfBounds, t as convertToArrayOfNumbers, u as convertDataToISO, x as getToday, y as getClosestValidDate, z as generateMonths, A as getNumDaysInMonth, B as getCombinedDateColumnData, C as getMonthColumnData, D as getDayColumnData, E as getYearColumnData, F as isMonthFirstLocale, G as getTimeColumnsData, H as isLocaleDayPeriodRTL, I as getDaysOfWeek, J as getMonthAndYear, K as getDaysOfMonth, L as getHourCycle, M as getLocalizedTime, N as getMonthAndDay, O as formatValue, P as clampDate, Q as parseAmPm, R as calculateHourFromAMPM } from './data-0f3ab200.js';
|
|
13
13
|
import { c as createLockController } from './lock-controller-316928be.js';
|
|
14
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-
|
|
14
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-f628ea0d.js';
|
|
15
15
|
import { c as createAnimation } from './animation-60dbdd13.js';
|
|
16
16
|
import { b as hapticSelectionChanged, h as hapticSelectionEnd, a as hapticSelectionStart } from './haptic-554688a5.js';
|
|
17
17
|
import './index-a5d50daf.js';
|
|
@@ -5,7 +5,7 @@ import { r as registerInstance, d as createEvent, h, H as Host, f as getElement
|
|
|
5
5
|
import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './config-49c88215.js';
|
|
6
6
|
import { r as raf } from './helpers-c0b9ca37.js';
|
|
7
7
|
import { c as createLockController } from './lock-controller-316928be.js';
|
|
8
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod } from './overlays-
|
|
8
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod } from './overlays-f628ea0d.js';
|
|
9
9
|
import { g as getClassMap } from './theme-01f3f29c.js';
|
|
10
10
|
import { c as config, b as getIonMode } from './ionic-global-ad9a1810.js';
|
|
11
11
|
import { c as createAnimation } from './animation-60dbdd13.js';
|
|
@@ -7,7 +7,7 @@ import { G as GESTURE_CONTROLLER } from './gesture-controller-1bf57181.js';
|
|
|
7
7
|
import { shoudUseCloseWatcher } from './hardware-back-button-b410a047.js';
|
|
8
8
|
import { p as isEndSide, i as inheritAriaAttributes, o as assert, l as clamp } from './helpers-c0b9ca37.js';
|
|
9
9
|
import { m as menuController } from './index-47b2066d.js';
|
|
10
|
-
import { o as getPresentedOverlay } from './overlays-
|
|
10
|
+
import { o as getPresentedOverlay } from './overlays-f628ea0d.js';
|
|
11
11
|
import { c as config, b as getIonMode } from './ionic-global-ad9a1810.js';
|
|
12
12
|
import { c as createColorClasses, h as hostContext } from './theme-01f3f29c.js';
|
|
13
13
|
import { u as menuOutline, v as menuSharp } from './index-f7dc70ba.js';
|
|
@@ -8,7 +8,7 @@ import { g as getElementRoot, l as clamp, r as raf, k as inheritAttributes, m as
|
|
|
8
8
|
import { c as createLockController } from './lock-controller-316928be.js';
|
|
9
9
|
import { p as printIonWarning } from './index-9b0d46f4.js';
|
|
10
10
|
import { g as getCapacitor } from './capacitor-59395cbd.js';
|
|
11
|
-
import { G as GESTURE, O as OVERLAY_GESTURE_PRIORITY, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod } from './overlays-
|
|
11
|
+
import { G as GESTURE, O as OVERLAY_GESTURE_PRIORITY, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod } from './overlays-f628ea0d.js';
|
|
12
12
|
import { g as getClassMap } from './theme-01f3f29c.js';
|
|
13
13
|
import { e as deepReady, w as waitForMount } from './index-0b4beb69.js';
|
|
14
14
|
import { b as getIonMode, c as config } from './ionic-global-ad9a1810.js';
|
|
@@ -6,7 +6,7 @@ import { C as CoreDelegate, a as attachComponent, d as detachComponent } from '.
|
|
|
6
6
|
import { r as raf, g as getElementRoot, a as addEventListener, m as hasLazyBuild } from './helpers-c0b9ca37.js';
|
|
7
7
|
import { c as createLockController } from './lock-controller-316928be.js';
|
|
8
8
|
import { p as printIonWarning } from './index-9b0d46f4.js';
|
|
9
|
-
import { B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, n as focusFirstDescendant, g as dismiss, h as eventMethod } from './overlays-
|
|
9
|
+
import { B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, n as focusFirstDescendant, g as dismiss, h as eventMethod } from './overlays-f628ea0d.js';
|
|
10
10
|
import { b as getIonMode, a as isPlatform } from './ionic-global-ad9a1810.js';
|
|
11
11
|
import { g as getClassMap } from './theme-01f3f29c.js';
|
|
12
12
|
import { e as deepReady, w as waitForMount } from './index-0b4beb69.js';
|
|
@@ -7,7 +7,7 @@ import { c as createNotchController } from './notch-controller-15d281a4.js';
|
|
|
7
7
|
import { i as isOptionSelected, c as compareOptions } from './compare-with-utils-a96ff2ea.js';
|
|
8
8
|
import { k as inheritAttributes, f as focusElement, h as findItemLabel, d as renderHiddenInput, e as getAriaLabel } from './helpers-c0b9ca37.js';
|
|
9
9
|
import { p as printIonWarning } from './index-9b0d46f4.js';
|
|
10
|
-
import { c as popoverController, b as actionSheetController, a as alertController, s as safeCall } from './overlays-
|
|
10
|
+
import { c as popoverController, b as actionSheetController, a as alertController, s as safeCall } from './overlays-f628ea0d.js';
|
|
11
11
|
import { i as isRTL } from './dir-babeabeb.js';
|
|
12
12
|
import { h as hostContext, c as createColorClasses, g as getClassMap } from './theme-01f3f29c.js';
|
|
13
13
|
import { w as watchForOptions } from './watch-options-c2911ace.js';
|
|
@@ -6,7 +6,7 @@ import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './conf
|
|
|
6
6
|
import { g as getElementRoot, r as raf } from './helpers-c0b9ca37.js';
|
|
7
7
|
import { c as createLockController } from './lock-controller-316928be.js';
|
|
8
8
|
import { p as printIonWarning } from './index-9b0d46f4.js';
|
|
9
|
-
import { O as OVERLAY_GESTURE_PRIORITY, d as createDelegateController, e as createTriggerController, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall, G as GESTURE } from './overlays-
|
|
9
|
+
import { O as OVERLAY_GESTURE_PRIORITY, d as createDelegateController, e as createTriggerController, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall, G as GESTURE } from './overlays-f628ea0d.js';
|
|
10
10
|
import { g as getClassMap, c as createColorClasses } from './theme-01f3f29c.js';
|
|
11
11
|
import { c as config, b as getIonMode } from './ionic-global-ad9a1810.js';
|
|
12
12
|
import { c as createAnimation } from './animation-60dbdd13.js';
|
|
@@ -408,6 +408,15 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
408
408
|
return;
|
|
409
409
|
}
|
|
410
410
|
setRootAriaHidden(true);
|
|
411
|
+
/**
|
|
412
|
+
* Hide all other overlays from screen readers so only this one
|
|
413
|
+
* can be read. Note that presenting an overlay always makes
|
|
414
|
+
* it the topmost one.
|
|
415
|
+
*/
|
|
416
|
+
if (doc !== undefined) {
|
|
417
|
+
const presentedOverlays = getPresentedOverlays(doc);
|
|
418
|
+
presentedOverlays.forEach((o) => o.setAttribute('aria-hidden', 'true'));
|
|
419
|
+
}
|
|
411
420
|
overlay.presented = true;
|
|
412
421
|
overlay.willPresent.emit();
|
|
413
422
|
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
@@ -441,6 +450,14 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
441
450
|
if (overlay.keyboardClose && (document.activeElement === null || !overlay.el.contains(document.activeElement))) {
|
|
442
451
|
overlay.el.focus();
|
|
443
452
|
}
|
|
453
|
+
/**
|
|
454
|
+
* If this overlay was previously dismissed without being
|
|
455
|
+
* the topmost one (such as by manually calling dismiss()),
|
|
456
|
+
* it would still have aria-hidden on being presented again.
|
|
457
|
+
* Removing it here ensures the overlay is visible to screen
|
|
458
|
+
* readers.
|
|
459
|
+
*/
|
|
460
|
+
overlay.el.removeAttribute('aria-hidden');
|
|
444
461
|
};
|
|
445
462
|
/**
|
|
446
463
|
* When an overlay component is dismissed,
|
|
@@ -466,7 +483,7 @@ const focusPreviousElementOnDismiss = async (overlayEl) => {
|
|
|
466
483
|
previousElement.focus();
|
|
467
484
|
};
|
|
468
485
|
const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnimation, opts) => {
|
|
469
|
-
var _a, _b;
|
|
486
|
+
var _a, _b, _c;
|
|
470
487
|
if (!overlay.presented) {
|
|
471
488
|
return false;
|
|
472
489
|
}
|
|
@@ -517,6 +534,13 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
517
534
|
console.error(err);
|
|
518
535
|
}
|
|
519
536
|
overlay.el.remove();
|
|
537
|
+
/**
|
|
538
|
+
* If there are other overlays presented, unhide the new
|
|
539
|
+
* topmost one from screen readers.
|
|
540
|
+
*/
|
|
541
|
+
if (doc !== undefined) {
|
|
542
|
+
(_c = getPresentedOverlay(doc)) === null || _c === void 0 ? void 0 : _c.removeAttribute('aria-hidden');
|
|
543
|
+
}
|
|
520
544
|
return true;
|
|
521
545
|
};
|
|
522
546
|
const getAppRoot = (doc) => {
|
package/dist/esm-es5/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
export{c as createAnimation}from"./animation-60dbdd13.js";export{a as LIFECYCLE_DID_ENTER,c as LIFECYCLE_DID_LEAVE,L as LIFECYCLE_WILL_ENTER,b as LIFECYCLE_WILL_LEAVE,d as LIFECYCLE_WILL_UNLOAD,g as getIonPageElement}from"./index-0b4beb69.js";export{iosTransitionAnimation}from"./ios.transition-b76c7020.js";export{mdTransitionAnimation}from"./md.transition-564937a7.js";export{g as getTimeGivenProgression}from"./cubic-bezier-fe2083dc.js";export{createGesture}from"./index-2cf77112.js";export{g as getPlatforms,i as initialize,a as isPlatform}from"./ionic-global-ad9a1810.js";export{c as componentOnReady}from"./helpers-c0b9ca37.js";export{I as IonicSafeString,g as getMode,s as setupConfig}from"./config-49c88215.js";export{o as openURL}from"./theme-01f3f29c.js";export{m as menuController}from"./index-47b2066d.js";export{b as actionSheetController,a as alertController,l as loadingController,m as modalController,p as pickerController,c as popoverController,t as toastController}from"./overlays-
|
|
4
|
+
export{c as createAnimation}from"./animation-60dbdd13.js";export{a as LIFECYCLE_DID_ENTER,c as LIFECYCLE_DID_LEAVE,L as LIFECYCLE_WILL_ENTER,b as LIFECYCLE_WILL_LEAVE,d as LIFECYCLE_WILL_UNLOAD,g as getIonPageElement}from"./index-0b4beb69.js";export{iosTransitionAnimation}from"./ios.transition-b76c7020.js";export{mdTransitionAnimation}from"./md.transition-564937a7.js";export{g as getTimeGivenProgression}from"./cubic-bezier-fe2083dc.js";export{createGesture}from"./index-2cf77112.js";export{g as getPlatforms,i as initialize,a as isPlatform}from"./ionic-global-ad9a1810.js";export{c as componentOnReady}from"./helpers-c0b9ca37.js";export{I as IonicSafeString,g as getMode,s as setupConfig}from"./config-49c88215.js";export{o as openURL}from"./theme-01f3f29c.js";export{m as menuController}from"./index-47b2066d.js";export{b as actionSheetController,a as alertController,l as loadingController,m as modalController,p as pickerController,c as popoverController,t as toastController}from"./overlays-f628ea0d.js";import"./index-a5d50daf.js";import"./index-4c30cddd.js";import"./gesture-controller-1bf57181.js";import"./hardware-back-button-b410a047.js";import"./index-9b0d46f4.js";import"./framework-delegate-fed7fe7c.js";var IonicSlides=function(e){var o=e.swiper,t=e.extendParams;var s={effect:undefined,direction:"horizontal",initialSlide:0,loop:false,parallax:false,slidesPerView:1,spaceBetween:0,speed:300,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:false,slidesOffsetBefore:0,slidesOffsetAfter:0,touchEventsTarget:"container",freeMode:false,freeModeMomentum:true,freeModeMomentumRatio:1,freeModeMomentumBounce:true,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:false,freeModeMinimumVelocity:.02,autoHeight:false,setWrapperSize:false,zoom:{maxRatio:3,minRatio:1,toggle:false},touchRatio:1,touchAngle:45,simulateTouch:true,touchStartPreventDefault:false,shortSwipes:true,longSwipes:true,longSwipesRatio:.5,longSwipesMs:300,followFinger:true,threshold:0,touchMoveStopPropagation:true,touchReleaseOnEdges:false,iOSEdgeSwipeDetection:false,iOSEdgeSwipeThreshold:20,resistance:true,resistanceRatio:.85,watchSlidesProgress:false,watchSlidesVisibility:false,preventClicks:true,preventClicksPropagation:true,slideToClickedSlide:false,loopAdditionalSlides:0,noSwiping:true,runCallbacksOnInit:true,coverflowEffect:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:true},flipEffect:{slideShadows:true,limitRotation:true},cubeEffect:{slideShadows:true,shadow:true,shadowOffset:20,shadowScale:.94},fadeEffect:{crossFade:false},a11y:{prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide"}};if(o.pagination){s.pagination={type:"bullets",clickable:false,hideOnClick:false}}if(o.scrollbar){s.scrollbar={hide:true}}t(s)};export{IonicSlides};
|