Skip to content

Commit f301162

Browse files
fix(a11y): add keyboard support to no-signatures area and translatable action labels
- Add role='button', tabindex=0 and keydown handlers to .no-signatures div so keyboard users can activate it to start editing - Use translatable t('libresign', 'Delete {type}') and t('libresign', 'Edit {type}') in action button labels - Pass :alt with 'Current {type}' to PreviewSignature for context Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 2b22602 commit f301162

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/views/Account/partials/Signature.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,32 @@
1313
<template #icon>
1414
<NcIconSvgWrapper :path="mdiDelete" :size="20" />
1515
</template>
16+
<!-- TRANSLATORS {type} is the kind of signature element being deleted, e.g. "signature" or "initial" -->
17+
{{ t('libresign', 'Delete {type}', { type }) }}
1618
</NcActionButton>
1719
<NcActionButton @click="edit">
1820
<template #icon>
1921
<NcIconSvgWrapper :path="mdiDraw" :size="20" />
2022
</template>
23+
<!-- TRANSLATORS {type} is the kind of signature element being edited, e.g. "signature" or "initial" -->
24+
{{ t('libresign', 'Edit {type}', { type }) }}
2125
</NcActionButton>
2226
</NcActions>
2327
</header>
2428

2529
<div v-if="hasSignature">
2630
<PreviewSignature :src="imgSrc"
2731
:sign-request-uuid="signatureElementsStore.signRequestUuid"
32+
:alt="t('libresign', 'Current {type}', { type })"
2833
@loaded="signatureLoaded" />
2934
</div>
30-
<div v-else class="no-signatures" @click="edit">
35+
<div v-else
36+
class="no-signatures"
37+
role="button"
38+
tabindex="0"
39+
@click="edit"
40+
@keydown.enter.prevent="edit"
41+
@keydown.space.prevent="edit">
3142
<slot name="no-signatures" />
3243
</div>
3344

0 commit comments

Comments
 (0)