Skip to content

Commit

Permalink
[material-ui][Modal] Replace show parameter name with hide in mod…
Browse files Browse the repository at this point in the history
…al manager (#43868)
  • Loading branch information
ZeeshanTamboli authored Sep 26, 2024
1 parent 50d8c3b commit dbdea6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/mui-material/src/Modal/ModalManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ function isOverflowing(container: Element): boolean {
return container.scrollHeight > container.clientHeight;
}

export function ariaHidden(element: Element, show: boolean): void {
if (show) {
export function ariaHidden(element: Element, hide: boolean): void {
if (hide) {
element.setAttribute('aria-hidden', 'true');
} else {
element.removeAttribute('aria-hidden');
Expand Down Expand Up @@ -61,15 +61,15 @@ function ariaHiddenSiblings(
mountElement: Element,
currentElement: Element,
elementsToExclude: readonly Element[],
show: boolean,
hide: boolean,
): void {
const blacklist = [mountElement, currentElement, ...elementsToExclude];

[].forEach.call(container.children, (element: Element) => {
const isNotExcludedElement = !blacklist.includes(element);
const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
if (isNotExcludedElement && isNotForbiddenElement) {
ariaHidden(element, show);
ariaHidden(element, hide);
}
});
}
Expand Down

0 comments on commit dbdea6a

Please sign in to comment.