[v3]: use aria-describedby attribute #3773
Answered
by
logaretm
lightsaber6000
asked this question in
Q&A
-
Hi. Can i use aria-describedby attribute for error reference instead of aria-errormessage? Not all screen readers support it. |
Beta Was this translation helpful? Give feedback.
Answered by
logaretm
May 16, 2022
Replies: 1 comment
-
The default implementation uses <template>
<ValidationProvider
name="a11y"
rules="required|email"
:bails="false"
v-slot="{ errors, ariaMsg, ariaInput }"
>
<div>
<input type="text" v-model="value" v-bind="ariaInput" :aria-describedby="ariaMsg.id">
<span v-bind="ariaMsg">{{ errors[0] }}</span>
</div>
</ValidationProvider>
</template> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lightsaber6000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The default implementation uses
aria-errorMessage
since it can be reliably generated. You can addaria-describedby
manually and bind it toariaMsg.id
.