feat(a11y): add descriptive labels to task checkboxes

Adds aria-label='Mark {task} as done' to task checkboxes so
screen readers can distinguish between them. Passes ariaLabel
prop through FancyCheckbox → BaseCheckbox → input.

Fixes WCAG 2.4.6 (Headings and Labels).
This commit is contained in:
kolaente 2026-04-12 14:23:31 +02:00 committed by kolaente
parent 6f85a7fb6b
commit fd1a329f5d
3 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,7 @@
class="is-sr-only"
:checked="modelValue"
:disabled="disabled || undefined"
:aria-label="ariaLabel"
@change="(event) => emit('update:modelValue', (event.target as HTMLInputElement).checked)"
>
<slot />
@ -22,8 +23,10 @@
withDefaults(defineProps<{
modelValue?: boolean,
disabled: boolean,
ariaLabel?: string,
}>(), {
modelValue: false,
ariaLabel: undefined,
})
const emit = defineEmits<{

View File

@ -7,6 +7,7 @@
}"
:disabled="disabled"
:model-value="modelValue"
:aria-label="ariaLabel"
@update:modelValue="value => emit('update:modelValue', value)"
>
<CheckboxIcon class="fancy-checkbox__icon" />
@ -26,10 +27,12 @@ import BaseCheckbox from '@/components/base/BaseCheckbox.vue'
withDefaults(defineProps<{
modelValue: boolean,
disabled?: boolean,
isBlock?: boolean
isBlock?: boolean,
ariaLabel?: string,
}>(), {
disabled: false,
isBlock: false,
ariaLabel: undefined,
})
const emit = defineEmits<{

View File

@ -19,6 +19,7 @@
<FancyCheckbox
v-model="task.done"
:disabled="isArchived || disabled || !canMarkAsDone"
:aria-label="$t('task.detail.markAsDone', {task: task.title})"
@update:modelValue="markAsDone"
@click.stop
/>