Skip to content

feat(material/slider): Update range slider to use role="list" around the slider thumbs #23607

Open
@jelbourn

Description

@jelbourn

Currently the range slider presents itself as two independent slider controls. If we were to make the mat-slider element role="list" and wrap each <input> element in a role="listitem", assistive technology will announce indices for the sliders as well as the label for the entire range slider as well. The rendered result would look something like

<mat-slider role="list" aria-label="...">
  <div role="listitem"><input type="range" aria-label="..."></div>
  <div role="listitem"><input type="range" aria-label="..."></div>
  <div class="mdc-slider__track" aria-hidden="true">...</div>
  <mat-slider-visual-thumb aria-hidden="true">...</mat-slider-visual-thumb>
  <mat-slider-visual-thumb aria-hidden="true">...</mat-slider-visual-thumb>
</mat-slider>

The non-listitem children of role="list" need to be given aria-hidden to prevent them as counting as list items.

The work here would be

  • Create a proof of concept
  • Test the proof of concept in all screen-readers that we support
    • ChromeVox
    • NVDA
    • JAWS
    • VoiceOver
    • TalkBalk
  • Make the change
  • Update documentation for best practices

Metadata

Metadata

Assignees

No one assigned

    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/sliderfeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions