fix(VInput): Remove redundant aria roles in v-input #21609
+0
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: