fix(header): hide from screen readers when collapsed (#25744)

This commit is contained in:
Amanda Johnston
2022-08-11 09:04:48 -05:00
committed by GitHub
parent 2ddaf7a5a2
commit d0ba963599
4 changed files with 129 additions and 7 deletions

View File

@ -164,10 +164,14 @@ export const handleToolbarIntersection = (
};
export const setHeaderActive = (headerIndex: HeaderIndex, active = true) => {
const headerEl = headerIndex.el;
if (active) {
headerIndex.el.classList.remove('header-collapse-condense-inactive');
headerEl.classList.remove('header-collapse-condense-inactive');
headerEl.removeAttribute('aria-hidden');
} else {
headerIndex.el.classList.add('header-collapse-condense-inactive');
headerEl.classList.add('header-collapse-condense-inactive');
headerEl.setAttribute('aria-hidden', 'true');
}
};