Skip to content

Commit 24bd7da

Browse files
authored
fix: update dashboard section role attribute to region (#10599)
1 parent 98af8fd commit 24bd7da

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

packages/dashboard/src/vaadin-dashboard-section.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ class DashboardSection extends DashboardItemMixin(
159159
/** @protected */
160160
ready() {
161161
super.ready();
162+
162163
if (!this.hasAttribute('role')) {
163-
this.setAttribute('role', 'section');
164+
this.setAttribute('role', 'region');
164165
}
165166
}
166167
}

packages/dashboard/test/dashboard-section.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ describe('dashboard section', () => {
3434

3535
describe('a11y', () => {
3636
it('should have role="section"', () => {
37-
expect(section.getAttribute('role')).to.eql('section');
37+
expect(section.getAttribute('role')).to.eql('region');
3838
});
3939

4040
it('should not override custom role', async () => {
41-
section = fixtureSync(`<vaadin-dashboard-section role="region"></vaadin-dashboard-section>`);
41+
section = fixtureSync(`<vaadin-dashboard-section role="banner"></vaadin-dashboard-section>`);
4242
await nextFrame();
43-
expect(section.getAttribute('role')).to.eql('region');
43+
expect(section.getAttribute('role')).to.eql('banner');
4444
});
4545

4646
it('should have text content for the title', async () => {

packages/dashboard/test/dom/__snapshots__/dashboard-section.test.snap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
export const snapshots = {};
33

44
snapshots["vaadin-dashboard-section host"] =
5-
`<vaadin-dashboard-section role="section">
5+
`<vaadin-dashboard-section role="region">
66
</vaadin-dashboard-section>
77
`;
88
/* end snapshot vaadin-dashboard-section host */

0 commit comments

Comments
 (0)