Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VTextField): messages not announced correctly by screen readers #17448

Open
wants to merge 3 commits into
base: v2-stable
Choose a base branch
from

Conversation

deraw
Copy link

@deraw deraw commented May 24, 2023

Description

Fixes #13874 by adding the aria-describedby property on the input element and an id on VMessages.
I've not added aria-describedby in VInput since it needs to be applied to the input element in order to be announced.

I'v tested this with NVDA on Windows.

Markup:

<template>
  <div>
    <v-form>
      <v-text-field
        label="Use Screen reader"
        hint="For example, flowers or used cars"
      ></v-text-field>

      <v-text-field
        label="Use Screen reader"
        hint="sample hint message to check if screen reader reads this"
        persistent-hint
      ></v-text-field>

      <v-text-field
        :rules="[rules.required, rules.counter]"
        label="Use Screen reader"
        hint="sample hint message to check if screen reader reads this"
        persistent-hint
      ></v-text-field>
    </v-form>
  </div>
</template>

<script>
  export default {
    data: () => ({
      rules: {
        required: value => !!value || 'Required.',
        counter: value => value?.length <= 2 || 'Max 2 characters',
      },
    }),
  }
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VTextField VTextField T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants