Skip to content
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

fix(ui5-dynamic-page): fix header role #10317

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/fiori/src/DynamicPage.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
id="{{_id}}-header"
aria-label="{{_headerLabel}}"
aria-expanded="{{_headerExpanded}}"
role="region"
@ui5-_toggle-title={{onToggleTitle}}
>
<slot name="titleArea"></slot>
Expand All @@ -17,7 +16,7 @@
{{> header-actions}}
{{/if}}
</header>

{{#if headerInContent}}
<slot tabindex="{{headerTabIndex}}" ?aria-hidden="{{headerAriaHidden}}" name="headerArea"></slot>
{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion packages/fiori/src/DynamicPageHeader.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="ui5-dynamic-page-header-root">
<div class="ui5-dynamic-page-header-root" role="region">
<slot></slot>
</div>
5 changes: 2 additions & 3 deletions packages/fiori/test/specs/DynamicPage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ describe("ARIA attributes", () => {
const title = await browser.$("#page ui5-dynamic-page-title");
const titleFocusArea = await title.shadow$(".ui5-dynamic-page-title-focus-area");
const headerWrapper = await page.shadow$(".ui5-dynamic-page-title-header-wrapper");
const headerRoot = await page.$("ui5-dynamic-page-header").shadow$(".ui5-dynamic-page-header-root");
const headerActions = await page.shadow$("ui5-dynamic-page-header-actions");
const expandButton = await headerActions.shadow$("ui5-button.ui5-dynamic-page-header-action-expand");
const pinButton = await headerActions.shadow$("ui5-toggle-button.ui5-dynamic-page-header-action-pin");
Expand All @@ -418,7 +419,7 @@ describe("ARIA attributes", () => {
"aria-label value is correct");
assert.strictEqual(await headerWrapper.getAttribute("aria-expanded"), "true",
"aria-expanded value is correct");
assert.strictEqual(await headerWrapper.getAttribute("role"), "region",
assert.strictEqual(await headerRoot.getAttribute("role"), "region",
"header role is correct");

assert.strictEqual(await titleFocusArea.getAttribute("aria-expanded"), "true",
Expand Down Expand Up @@ -453,8 +454,6 @@ describe("ARIA attributes", () => {
"aria-label value is correct");
assert.strictEqual(await headerWrapper.getAttribute("aria-expanded"), "false",
"aria-expanded value is correct");
assert.strictEqual(await headerWrapper.getAttribute("role"), "region",
"role is correct");

assert.strictEqual(await titleFocusArea.getAttribute("aria-expanded"), "false",
"aria-expanded value is correct");
Expand Down
Loading