Skip to content

Commit 3ea22a3

Browse files
fix(a11y): add live region and improve chip label in signature positions modal
- Add sr-only aria-live='polite' region that announces 'Select a signer to set their signature position' when no signer is selected - Add aria-label to NcChip with document status for screen readers - Wrap instruction text in <span> to prevent it leaking into the Cancel button's accessible name Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 5da7b08 commit 3ea22a3

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

src/components/Request/VisibleElements.vue

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,26 @@
1515
<div v-else class="visible-elements-container">
1616
<div class="sign-details">
1717
<div class="modal_name">
18-
<NcChip :text="statusLabel" :variant="isDraft ? 'warning' : 'primary'" no-close />
18+
<NcChip :text="statusLabel"
19+
:variant="isDraft ? 'warning' : 'primary'"
20+
:aria-label="t('libresign', 'Document status: {status}', { status: statusLabel })"
21+
no-close />
1922
<h2 class="name">{{ document.name }}</h2>
2023
</div>
24+
<span role="status"
25+
aria-live="polite"
26+
aria-atomic="true"
27+
class="sr-only">
28+
<template v-if="!signerSelected">{{ t('libresign', 'Select a signer to set their signature position') }}</template>
29+
</span>
2130
<p v-if="!signerSelected">
2231
<NcNoteCard type="info"
2332
:text="t('libresign', 'Select a signer to set their signature position')" />
2433
</p>
2534
<ul class="view-sign-detail__sidebar">
2635
<li v-if="signerSelected"
2736
:class="{ tip: signerSelected }">
28-
{{ t('libresign', 'Click on the place you want to add.') }}
37+
<span>{{ t('libresign', 'Click on the place you want to add.') }}</span>
2938
<NcButton variant="primary"
3039
@click="stopAddSigner">
3140
{{ t('libresign', 'Cancel') }}
@@ -533,6 +542,17 @@ export default {
533542
border-radius: 4px;
534543
text-align: center;
535544
}
545+
.sr-only {
546+
position: absolute;
547+
width: 1px;
548+
height: 1px;
549+
padding: 0;
550+
margin: -1px;
551+
overflow: hidden;
552+
clip: rect(0, 0, 0, 0);
553+
white-space: nowrap;
554+
border: 0;
555+
}
536556
}
537557
}
538558
</style>

0 commit comments

Comments
 (0)