Skip to content

Commit 0b0b0fb

Browse files
fix(a11y): add role and sr-only instruction to drawing canvas
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 2b2d837 commit 0b0b0fb

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/components/Draw/Editor.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
:aria-label="t('libresign', 'Choose color')" />
1919
</NcColorPicker>
2020
</div>
21+
<!-- TRANSLATORS Accessible label for the button that clears the current drawing from the canvas. Does not delete any saved file. -->
2122
<NcButton :aria-label="t('libresign', 'Delete')"
2223
@click="clear">
2324
<template #icon>
@@ -26,8 +27,14 @@
2627
</NcButton>
2728
</div>
2829
<div ref="canvasWrapper" class="canvas-wrapper">
30+
<p class="sr-only">
31+
<!-- TRANSLATORS Screen-reader-only instruction for the signature drawing canvas. "Text" and "Upload" must match the translated labels of the other two tabs in this dialog. -->
32+
{{ t('libresign', 'Drawing area. Use a mouse or touch screen to draw your signature. If you cannot draw, use the Text or Upload tabs instead.') }}
33+
</p>
2934
<canvas ref="canvas"
3035
class="canvas"
36+
:aria-label="t('libresign', 'Draw your signature here')"
37+
role="img"
3138
_width="10px"
3239
_height="10px" />
3340
</div>
@@ -253,4 +260,15 @@ img{
253260
width: 100%;
254261
}
255262
}
263+
.sr-only {
264+
position: absolute;
265+
width: 1px;
266+
height: 1px;
267+
padding: 0;
268+
margin: -1px;
269+
overflow: hidden;
270+
clip: rect(0, 0, 0, 0);
271+
white-space: nowrap;
272+
border: 0;
273+
}
256274
</style>

0 commit comments

Comments
 (0)