Skip to content

[v3]: use aria-describedby attribute #3773

Answered by logaretm
lightsaber6000 asked this question in Q&A
Discussion options

You must be logged in to vote

The default implementation uses aria-errorMessage since it can be reliably generated. You can add aria-describedby manually and bind it to ariaMsg.id.

<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>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lightsaber6000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3772 on May 16, 2022 21:32.