-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
onAccessibilityTap does not work on Android #47149
Comments
|
|
|
|
Seems the same issue is reproducible for the latest RN version |
@Aksana-Tsishchanka Can you provide a reproducer? If possible in the latest version of react native |
Hey there, I can reproduce it with the latest RN version. However, after reviewing the documentation I found that another property which is https://reactnative.dev/docs/0.72/accessibility#accessibility-actions do the same and work for Android. It might be worth to update the RN documentation for https://reactnative.dev/docs/0.72/accessibility#onaccessibilitytap clarify that it's only for IOS and how it differs from https://reactnative.dev/docs/0.72/accessibility#accessibility-actions |
I am closing the original issue, thanks |
Description
The official documentation https://reactnative.dev/docs/0.72/accessibility#onaccessibilitytap does not have any platform specific label, however this method does not work on Android.
TS documentation in https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/View/ViewAccessibility.d.ts#L302 say it's IOS only.
But having accessibility actions for Android and IOS is extremely important feature. Could you please fix the issue.
Here the code that should call a provide callback on accessibility actions:
tech details:
I have the same issue with RN 0.72.6. Here is my code:
const a11yActions = [
{ name: 'add', label: 'Add the library' },
{ name: 'more', label: 'Open menu' },
]
<Pressable
accessibilityActions={a11yActions}
onAccessibilityTap={() => {
if (event.nativeEvent.actionName === 'add') {
firstButtonProps.onPress(event)
}
if (event.nativeEvent.actionName === 'more') {
secondButtonProps?.onPress(event)
}
}}
On Android when a screen reader is turn on, the bottom sheet with the defined actions appears but activation 'add' or 'more' does not call a provided callback.
Similar issue is reported here #34136
Steps to reproduce
const a11yActions = [
{ name: 'add', label: 'Add the library' },
{ name: 'more', label: 'Open menu' },
]
<Pressable
accessibilityActions={a11yActions}
onAccessibilityTap={() => {
if (event.nativeEvent.actionName === 'add') {
firstButtonProps.onPress(event)
}
if (event.nativeEvent.actionName === 'more') {
secondButtonProps?.onPress(event)
}
}}
On Android when a screen reader is turn on, the bottom sheet with the defined actions appears but activation 'add' or 'more' does not call a provided callback.
React Native Version
0.72.6
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
x
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: