Skip to content

Let Chip get custom accessibility roles #4384

@billomore

Description

@billomore

Is your feature request related to a problem? Please describe.
The Chip component is frequently used for display purposes, and in these cases is often never clickable. However, the Chip element still announces as a button because it has accessibilityRole="button" hardcoded.

When the Chip element is not being used as a button, a more sensible accessibilityRole should be able to be passed through. This PR keeps the default "button" accessibilityRole, but adds the ability to pass in a different accessibilityRole if "button" doesn't make sense.

Describe the solution you'd like
I'd like to be able to pass custom accessibility roles to Chips.

There's a PR #4327 by @meatnordrink that fixes the issue, it's really simple and straightforward.

Describe alternatives you've considered
Creating my own Chip component could be an alternative, but I really like the concept of having as much UI elements as possible under one lib.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions