Skip to content

docs: Update TouchableRipple.tsx to note a11y considerations #4777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

meatnordrink
Copy link
Contributor

@meatnordrink meatnordrink commented Jul 23, 2025

Motivation

Not passing an onPress to TouchableRipple silently breaks the component for users of several types of accessibility technologies (screen reader, voice control, likely others), either by hiding the element completely (voice control) or announcing it as dimmed/disabled (screen readers), even if there's an active onPress in an interior component.

Most mobile developers do not QA their work on accessibility technologies, so this likely results in many app functions being made inaccessible to accessibility technology users.

Noting this in the docs would help catch at least devs who read the docs and make them aware of how to preserve the a11y of their UIs using this component.

Stronger alternatives would be to make onPress required; or to add nuance to this logic, and the logic dependent on it:

// TouchableRipple.tsx, line 270
const disabled = disabledProp || !hasPassedTouchHandler;

However, updating the docs is a low lift that will help the issue, without requiring any changes in the principles of the component.

If there's openness to either of the other solutions, I'm happy to take a crack at it, but it would require departing from the principle, which looks to be explicitly stated in the code, that a TouchableRipple without an onPress is disabled.

Related issue

n/a

Test plan

Read the updated docs, make sure they're clear and formatted correctly.

@callstack-bot
Copy link

callstack-bot commented Jul 23, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants