Skip to content

fix(VInput): Remove redundant aria roles in v-input #21609

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yncat
Copy link

@yncat yncat commented Jun 19, 2025

Description

There was a critical issue using v-input with screen readers. Because it had role="alert" applied immediately upon rendering, screen readers would repeat “alert” as many times as there were v-input components on the screen after page load. For example, if I had 5 input boxes in a page, I had to hear "alert alert alert alert alert" as the page finished loading. This issue significantly interrupted screen reader users' browsing experience.

I also removed aria-live="polite" as it was functionally redundant with role="alert".

Although alert role is no longer present, error messages are still announced correctly when they appear because the messages area is connected via aria-describedby. So, this change simply eliminates the redundant “alert” announcements without compromising the accessibility of the component.

I’ve tested this locally and confirmed that it works as expected. I hope the dev team can integrate this fix into the next patch version.

Markup:

<template>
  <v-app>
    <v-app-bar app color="primary" dark>
      <v-app-bar-title>Vue + Vuetify テスト</v-app-bar-title>
    </v-app-bar>

    <v-main>
      <v-container>
        <v-row>
          <v-col cols="12">
            <h1 class="text-h2 mb-4">Vue.js + Vuetify test!</h1>

            <v-card>
              <v-card-title>Form</v-card-title>
              <v-card-text>
                <v-text-field
                  label="Name"
                  prepend-icon="mdi-account"
                  v-model="name"
                  :rules="[rules.required]"
                ></v-text-field>
                <v-text-field
                  label="Email"
                  prepend-icon="mdi-email"
                  type="email"
                  v-model="email"
                  :rules="[rules.required]"
                ></v-text-field>
                <v-btn color="primary" @click="showAlert">
                  Submit
                </v-btn>
              </v-card-text>
            </v-card>
          </v-col>
        </v-row>
      </v-container>
    </v-main>
  </v-app>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      name: '',
      email: '',
      rules: {
        required: value => !!value || '入力は必須です'
      }
    }
  },
  methods: {
    showAlert() {
      alert(`Hello, ${this.name || 'John Doe'}!`)
    }
  }
}
</script>

There was a critical issue using v-input with screen readers. Since it had role=alert from the start of its render, screen readers, as the page loads, repeated 'alert' same times as the number of v-input on the screen. This issue significantly interrupted screen reader users.
@yncat yncat changed the title Fix: Remove redundant aria roles in v-input fix: Remove redundant aria roles in v-input Jun 19, 2025
@yncat yncat changed the title fix: Remove redundant aria roles in v-input fix(VInput): Remove redundant aria roles in v-input Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant