react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

fix: allow pass-through of accessibilityRole on Chip

Open meatnordrink opened this issue 1 year ago • 5 comments
trafficstars

Motivation

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.

Related issue

n/a

Test plan

  • Pass accessibilityRole='text' as a prop to a Chip, and navigate to the Chip via screen reader. It should not announce as a button.
  • Do not pass any accessibilityRole prop, and navigate to the chip via screen reader; it should announce as a button.

I have tested this locally, and it works as expected.

meatnordrink avatar Feb 27 '24 13:02 meatnordrink

Hey @meatnordrink, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

callstack-bot avatar Feb 27 '24 13:02 callstack-bot

very simple, straightforward and important PR. As one who uses chips for display purposes often, it will help a lot

billomore avatar Apr 25 '24 00:04 billomore

LGTM, this PR will be on version 5.12.4

gedu avatar Apr 27 '24 07:04 gedu

@gedu can you explain why the PR was not merged, only is waiting for release? How you can release something if the PR was not merged?

I'm asking because I want to contribute, and no one even bother to merge a valid PR that was accepted. A lot of unanswered issues. Doesn't look like a well maintained project.

jcubic avatar May 19 '24 17:05 jcubic

@gedu can you explain why the PR was not merged, only is waiting for release? How you can release something if the PR was not merged?

I'm asking because I want to contribute, and no one even bother to merge a valid PR that was accepted. A lot of unanswered issues. Doesn't look like a well maintained project.

Hey, the main maintainer is on vacation, and I was hopping to chat with him to know more about the process, that's why I didn't merge it. On the other hand, the last weeks were really complicated on my side. I tried to replay Issues and on Discord We really appreciate your contribution, hope you can keep doing it.

gedu avatar May 20 '24 05:05 gedu