Skip to content

bug(mat-slide-toggle): aria-checked attribute duplicates native functionality #25134

Open
@LucaBastelt

Description

@LucaBastelt

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Using the https://validator.w3.org/nu/ validator the mat-slide-toggle gets reported as an aerror because it uses an arua-checked attribute on a input with the role of checkbox.

This has already been discussed here, but I have not found a report in this repository yet.

Reproduction

Steps to reproduce:

  1. Add a simple mat-slide-toggle to a template
  2. Observe the output html

Expected Behavior

The component should use native html features instead of aria attributes wherever possible

Actual Behavior

The component gets rendered as follows
<input type="checkbox" role="switch" class="mat-slide-toggle-input cdk-visually-hidden" id="test-input" tabindex="0" aria-checked="true">

Environment

  • Angular: 13.3.11
  • CDK/Material: 13.3.9
  • Browser(s): Chrome 102.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    AccessibilityThis issue is related to accessibility (a11y)P5The team acknowledges the request but does not plan to address it, it remains open for discussionarea: material/slide-toggle

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions