Skip to content

mat-chip-grid sometimes adds aria-required=false without no role #17397

@mertdeg2

Description

@mertdeg2

Bug, feature request, or proposal:

Bug

What is the expected behavior?

aria-required should only be used when we have valid role attribute.

What is the current behavior?

I am using mdc-chips backed mat-chip-grid implementation. mat-chip-grid component is adding aria-required=false without a role when grid has rows.

What are the steps to reproduce?

  1. Import MDC chips based mat-chip-grid implementation
  2. Paste following template
<mat-chip-grid #chipList>
    <mat-chip-row [removable]="true">
      chip
    </mat-chip-row>
    <input [matChipInputFor]="chipList"
                [matChipInputAddOnBlur]="true"/>
  </mat-chip-grid>
  1. Inspect browser DOM to see mat-chip-grid element has aria-required=false even though it doesn't have role attribute.

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

This is a potential accessibility violation reported by axe. aria-required=false doesn't make sense for non form elements: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-required_attribute

Metadata

Metadata

Assignees

Labels

AccessibilityThis issue is related to accessibility (a11y)GThis is is related to a Google internal issueP2The issue is important to a large percentage of users, with a workaround

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions