Skip to content
Merged
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
Add aria labels to dialogs
  • Loading branch information
christian-byrne committed Oct 8, 2024
commit b987a79cd31e280f52c369d1e2b4a4bee1679392
6 changes: 5 additions & 1 deletion src/components/dialog/GlobalDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
@maximize="onMaximize"
@unmaximize="onUnmaximize"
:pt="{ header: 'pb-0' }"
:aria-labelledby="headerId"
>
<template #header>
<component
v-if="dialogStore.headerComponent"
:is="dialogStore.headerComponent"
:id="headerId"
/>
<h3 v-else>{{ dialogStore.title || ' ' }}</h3>
<h3 v-else :id="headerId">{{ dialogStore.title || ' ' }}</h3>
</template>

<component :is="dialogStore.component" v-bind="contentProps" />
Expand Down Expand Up @@ -48,4 +50,6 @@ const contentProps = computed(() => ({
...dialogStore.props,
maximized: maximized.value
}))

const headerId = `dialog-${Math.random().toString(36).substr(2, 9)}`
</script>