Skip to content

Commit 7099fb7

Browse files
committed
refactor(overlays): use child
1 parent cd84ab6 commit 7099fb7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

core/src/utils/overlays.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,10 @@ const overlayAnimation = async (
754754

755755
animation.beforeAddWrite(() => {
756756
console.log('beforeAddWrite');
757-
baseEl.setAttribute('aria-hidden', 'true');
757+
const overlayWrapper = baseEl.querySelector('.ion-overlay-wrapper');
758+
if (overlayWrapper) {
759+
overlayWrapper.setAttribute('aria-hidden', 'true');
760+
}
758761

759762
if (overlay.keyboardClose) {
760763
const activeElement = baseEl.ownerDocument!.activeElement as HTMLElement;
@@ -765,10 +768,11 @@ const overlayAnimation = async (
765768
});
766769

767770
animation.afterAddWrite(() => {
768-
requestAnimationFrame(() => {
769-
baseEl.removeAttribute('aria-hidden');
770-
console.log('afterAddWrite');
771-
});
771+
const overlayWrapper = baseEl.querySelector('.ion-overlay-wrapper');
772+
if (overlayWrapper) {
773+
overlayWrapper.removeAttribute('aria-hidden');
774+
}
775+
console.log('afterAddWrite');
772776
});
773777

774778
const activeAni = activeAnimations.get(overlay) || [];

0 commit comments

Comments
 (0)