Skip to content

Commit 36788b1

Browse files
authored
docs: Update TouchableRipple.tsx to note a11y considerations
1 parent ff0df54 commit 36788b1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/TouchableRipple/TouchableRipple.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ export type Props = PressableProps & {
101101
* export default MyComponent;
102102
* ```
103103
*
104+
* ### Accessibility
105+
* Note that, while `onPress` is not a required prop, not passing an `onPress` prop directly to `TouchableRipple` (e.g., passing it to a component it wraps instead) will likely break the accessibility of the component.
106+
* When `onPress` is not present, the component will read as a "dimmed", inactive button to screen readers, and will not be reachable at all to voice control users.
107+
*
104108
* @extends Pressable props https://reactnative.dev/docs/Pressable#props
105109
*/
106110
const TouchableRipple = (

0 commit comments

Comments
 (0)