Skip to content

Commit 2837790

Browse files
committed
fix(header): aria hide the ion-title
1 parent 470decc commit 2837790

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

core/src/components/header/header.utils.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,25 @@ export const handleToolbarIntersection = (
167167

168168
export const setHeaderActive = (headerIndex: HeaderIndex, active = true) => {
169169
const headerEl = headerIndex.el;
170+
const toolbars = headerIndex.toolbars;
171+
const ionTitles = toolbars.map((toolbar) => toolbar.ionTitleEl);
170172

171173
if (active) {
172174
headerEl.classList.remove('header-collapse-condense-inactive');
173-
headerEl.removeAttribute('aria-hidden');
175+
176+
ionTitles.forEach((ionTitle) => {
177+
if (ionTitle) {
178+
ionTitle.removeAttribute('aria-hidden');
179+
}
180+
});
174181
} else {
175182
headerEl.classList.add('header-collapse-condense-inactive');
176-
headerEl.setAttribute('aria-hidden', 'true');
183+
184+
ionTitles.forEach((ionTitle) => {
185+
if (ionTitle) {
186+
ionTitle.setAttribute('aria-hidden', 'true');
187+
}
188+
});
177189
}
178190
};
179191

0 commit comments

Comments
 (0)