Skip to content

Commit

Permalink
Make content outside of Modal inert
Browse files Browse the repository at this point in the history
  • Loading branch information
stokesman committed Aug 19, 2023
1 parent 16dcc04 commit 6bf3f2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/components/src/modal/aria-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function hideApp( unhiddenElement?: HTMLDivElement ) {
return;
}
if ( elementShouldBeHidden( element ) ) {
element.setAttribute( 'aria-hidden', 'true' );
element.setAttribute( 'inert', '' );
hiddenElements.push( element );
}
} );
Expand All @@ -49,7 +49,7 @@ export function elementShouldBeHidden( element: Element ) {
const role = element.getAttribute( 'role' );
return ! (
element.tagName === 'SCRIPT' ||
element.hasAttribute( 'aria-hidden' ) ||
element.hasAttribute( 'inert' ) ||
element.hasAttribute( 'aria-live' ) ||
( role && LIVE_REGION_ARIA_ROLES.has( role ) )
);
Expand All @@ -64,7 +64,7 @@ export function showApp() {
return;
}
hiddenElements.forEach( ( element ) => {
element.removeAttribute( 'aria-hidden' );
element.removeAttribute( 'inert' );
} );
hiddenElements = [];
isHidden = false;
Expand Down

0 comments on commit 6bf3f2f

Please sign in to comment.