diff --git a/core/src/components/header/header.tsx b/core/src/components/header/header.tsx index e6218a2f3e..e922a38860 100644 --- a/core/src/components/header/header.tsx +++ b/core/src/components/header/header.tsx @@ -223,7 +223,7 @@ export class Header implements ComponentInterface { const isCondensed = collapse === 'condense'; // banner role must be at top level, so remove role if inside a menu - const roleType = getRoleType(hostContext('ion-menu', this.el), isCondensed, mode); + const roleType = getRoleType(hostContext('ion-menu', this.el), isCondensed, theme); return ( { +export const getRoleType = (isInsideMenu: boolean, isCondensed: boolean, theme: 'ios' | 'md' | 'ionic') => { // If the header is inside a menu, it should not have the banner role. if (isInsideMenu) { return ROLE_NONE; } /** - * Only apply role="none" to `md` mode condensed headers + * Only apply role="none" to `md` & `ionic` theme condensed headers * since the large header is never shown. */ - if (isCondensed && mode === 'md') { + if (isCondensed && theme !== 'ios') { return ROLE_NONE; } // Default to banner role.