Skip to content

SegmentedButtons: each segment sets aria-checked on role button #5181

Open

Description

@Doberjohn

Current behaviour

Each segment renders role="button" with aria-checked (SegmentedButtonItem.tsx). On the web aria-checked is not allowed on role button, so the checked state is not announced, and axe-core reports aria-allowed-attr (critical): "ARIA attribute is not allowed: aria-checked".

Expected behaviour

Each segment keeps aria-checked and takes a role that supports it: radio for single select (with the row as a radiogroup) and checkbox with multiSelect. axe reports no aria-allowed-attr violation.

How to reproduce?

  1. Run the example app on the web from main (yarn install, then npx expo start --web in example/).
  2. Open the Segmented Buttons example (/segmented-button).
  3. Run axe-core on the page.

Preview

What have you tried so far?

Your Environment

software version
react-native-paper main (8cb344b)
browser Chromium 153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions