-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix(header): ensure one banner role in condensed header #30718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to leave this as a comment instead of requesting changes in case this is a non-issue.
await expect(smallTitle).toHaveAttribute('aria-hidden', 'true'); | ||
}); | ||
|
||
test('should only have the banner role on the active header', async ({ page }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @returns 'none' if inside ion-menu or if condensed in md | ||
* mode, otherwise 'banner'. | ||
*/ | ||
export const getRoleType = (isInsideMenu: boolean, isCondensed: boolean, mode: 'ios' | 'md') => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll might have to update the mode
to theme
in next
.
Issue number: internal
What is the current behavior?
As per accessibility guidelines, there should only be one banner landmark per page. A condensed header creates two banner landmarks since 2
ion-header
components are required on the page.ion-header
renders with arole="banner"
by default (when not inion-menu
).The visual effect of the condensed header is achieved by rendering two distinct header components. Because both components exist in the code at the same time and both have
role="banner"
, they create a duplicate landmark announcement for screen readers. This leads to a violation with the accessibility guidelines.What is the new behavior?
none
orbanner
based off the header's active state.Does this introduce a breaking change?
Other information
Preview