Skip to content

Commit 4f19d4a

Browse files
committed
refactor(CModal): improve accessibility
1 parent 2ae86d3 commit 4f19d4a

File tree

1 file changed

+2
-1
lines changed
  • packages/coreui-vue/src/components/modal

1 file changed

+2
-1
lines changed

packages/coreui-vue/src/components/modal/CModal.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,15 @@ const CModal = defineComponent({
230230
h(
231231
'div',
232232
{
233+
...attrs,
233234
class: [
234235
'modal',
235236
{
236237
['fade']: props.transition,
237238
},
238239
attrs.class,
239240
],
241+
...(visible.value ? { 'aria-modal': true, role: 'dialog' } : { 'aria-hidden': 'true' }),
240242
ref: modalRef,
241243
},
242244
h(
@@ -253,7 +255,6 @@ const CModal = defineComponent({
253255
[`modal-${props.size}`]: props.size,
254256
},
255257
],
256-
role: 'dialog',
257258
},
258259
h(
259260
'div',

0 commit comments

Comments
 (0)