Fixes #14438: a11y: add semantic roles to habit and todo controls (#14467)

* a11y: add aria roles to habit control

* a11y: add role to todo checkboxes

* a11y: add aria-labels to score buttons
Helps with screen readers

* add i18n to aria-labels
This commit is contained in:
Ash
2023-06-19 23:00:16 +02:00
committed by GitHub
parent c3f0abadd7
commit e72a25ad02
2 changed files with 10 additions and 1 deletions

View File

@@ -32,6 +32,9 @@
'task-not-scoreable': showTaskLockIcon,
}, controlClass.up.inner]"
tabindex="0"
role="button"
:aria-label="$t('scoreUp')"
:aria-disabled="showTaskLockIcon || (!task.up && !showTaskLockIcon)"
@click="score('up')"
@keypress.enter="score('up')"
>
@@ -63,6 +66,7 @@
controlClass.inner,
]"
tabindex="0"
role="checkbox"
@click="score(showCheckIcon ? 'down' : 'up' )"
@keypress.enter="score(showCheckIcon ? 'down' : 'up' )"
>
@@ -359,6 +363,9 @@
'task-not-scoreable': showTaskLockIcon,
}, controlClass.down.inner]"
tabindex="0"
role="button"
:aria-label="$t('scoreDown')"
:aria-disabled="showTaskLockIcon || (!task.down && !showTaskLockIcon)"
@click="score('down')"
@keypress.enter="score('down')"
>