react-native-paper
react-native-paper copied to clipboard
fix: allow pass-through of accessibilityRole on Chip
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
accessibilityRoleprop, and navigate to the chip via screen reader; it should announce as a button.
I have tested this locally, and it works as expected.
Hey @meatnordrink, thank you for your pull request 🤗. The documentation from this branch can be viewed here.
very simple, straightforward and important PR. As one who uses chips for display purposes often, it will help a lot
LGTM, this PR will be on version 5.12.4
@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.
@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.