Skip to content

Commit

Permalink
fix: set role attribute on the CRUD edit dialog overlay (#7310) (#7319)
Browse files Browse the repository at this point in the history
Co-authored-by: Serhii Kulykov <[email protected]>
  • Loading branch information
vaadin-bot and web-padawan authored Apr 11, 2024
1 parent f86e0ec commit daa7981
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/crud/src/vaadin-crud-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class CrudDialog extends DialogBaseMixin(OverlayClassMixin(ThemePropertyMixin(Po
with-backdrop="[[!modeless]]"
resizable$="[[resizable]]"
fullscreen$="[[fullscreen]]"
role="dialog"
focus-trap
></vaadin-crud-dialog-overlay>
`;
Expand Down
8 changes: 7 additions & 1 deletion packages/crud/test/a11y.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ describe('a11y', () => {
});
});

describe('dialog aria-label', () => {
describe('dialog ARIA attributes', () => {
let newButton, editButtons, dialog;

beforeEach(async () => {
Expand All @@ -309,6 +309,12 @@ describe('a11y', () => {
await nextRender();
});

it('should set correct role attribute to the dialog overlay', async () => {
newButton.click();
await nextRender();
expect(dialog.$.overlay.getAttribute('role')).to.equal('dialog');
});

it('should set correct aria-label to the new item dialog', async () => {
newButton.click();
await nextRender();
Expand Down

0 comments on commit daa7981

Please sign in to comment.