Skip to content

Input being required should not result in aria-invalid="true" #18140

Closed
@micamp

Description

@micamp

Bug, feature request, or proposal:

Input being required should not result in aria-invalid="true".

What is the expected behavior?

An input field that is required should be marked as required in the HTML (which it is), but should not be marked as aria-invalid until the user enters an invalid value.

What is the current behavior?

An input field that is required is marked as both required and aria-invalid before any content is entered by the user.

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.

StackBlitz starter: https://goo.gl/wwnhMV

  1. Open the AM input example page
  2. Find the "Input with a custom ErrorStateMatcher" example
  3. Inspect the HTML of the input

Expected: The input element should have aria-invalid="false" or no aria-invalid attribute.
Actual: The input element has aria-invalid="true".

What is the use-case or motivation for changing an existing behavior?

It is confusing to users with a screen reader why it would be invalid before they have even entered any content.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Latest. It is on your example page.

Is there anything else we should know?

Thank you for your attention on this issue.

Metadata

Metadata

Assignees

Labels

AccessibilityThis issue is related to accessibility (a11y)P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/input

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions