Skip to content

Commit

Permalink
fix(Dialog): add aria-modal attribute for wider compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
LeBenLeBen committed Jun 8, 2022
1 parent 2f682e7 commit 9e02396
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/chusho/lib/components/CDialog/CDialog.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('CDialog', () => {
expect(wrapper.html()).toBe(`<!--teleport start-->
<!--teleport end-->`);
expect(document.querySelector('#chusho-dialogs-portal').innerHTML).toBe(
'<div tabindex="-1"><div role="dialog"></div></div>'
'<div tabindex="-1"><div role="dialog" aria-modal="true"></div></div>'
);
});

Expand Down Expand Up @@ -53,7 +53,7 @@ describe('CDialog', () => {
});

expect(document.querySelector('#chusho-dialogs-portal').innerHTML).toBe(
'<div class="overlay-custom overlay" tabindex="-1"><div class="dialog-custom dialog" role="dialog"></div></div>'
'<div class="overlay-custom overlay" tabindex="-1"><div class="dialog-custom dialog" role="dialog" aria-modal="true"></div></div>'
);
});

Expand Down
1 change: 1 addition & 0 deletions packages/chusho/lib/components/CDialog/CDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export default defineComponent({

const dialogProps = mergeProps(this.$attrs, {
role: 'dialog',
'aria-modal': 'true',
ref: 'dialogElement',
...generateConfigClass(this.config?.class, this.$props),
});
Expand Down

0 comments on commit 9e02396

Please sign in to comment.