Skip to content

Commit db9954c

Browse files
authored
Add accessibility info for buttons (#1599)
1 parent c450496 commit db9954c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/docs/api/components/buttons.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Currently Gesture handler library exposes three components that render native to
2121

2222
On top of that all the buttons are wrapped with `NativeViewGestureHandler` and therefore allow for all the [common gesture handler properties](#common-gesturehandler-properties) and `NativeViewGestureHandler`'s [extra properties](#nativeviewgesturehandler-extra-properties) to be applied to them.
2323

24-
**IMPORTANT**: In order to make buttons accessible, you have to wrap your children in a `View` with `accessible` prop.
24+
**IMPORTANT**: In order to make buttons accessible, you have to wrap your children in a `View` with `accessible` and `accessibilityRole="button"` props.
2525
Example:
2626

2727
```javascript
@@ -34,7 +34,7 @@ const NotAccessibleButton = () => (
3434
// Accessible:
3535
const AccessibleButton = () => (
3636
<RectButton onPress={this._onPress}>
37-
<View accessible>
37+
<View accessible accessibilityRole="button">
3838
<Text>Bar</Text>
3939
</View>
4040
</RectButton>

0 commit comments

Comments
 (0)