react-native
react-native copied to clipboard
accessibilityActions is causing problems with accessible props (Android - accessibility)
Description
Hi! This is an easy problem to describe.
We have this piece of code:
<View
style={style.rangeContainer}
{...accessibilityProps}
// @ts-ignore
onAccessibilityAction={onRangeAccessibilityAction}
>
<Text style={style.rangeTitle}>{label}</Text>
<Text style={style.selectedValue}>{value}</Text>
</View>
Where the accessibilityProps are these:
accessibilityActions: [
{
name: AccessibleSliderActions.decrement,
},
{
name: AccessibleSliderActions.increment,
},
],
accessibilityHint: sliderHint(label, step),
accessibilityLabel: sliderLabel(label, sliderValue, maximum),
accessibilityRole: 'adjustable',
accessible: true,
accessibleValue: { max: maximum, min: minimum, now: sliderValue },
Me and me team found that accessible and accessibilityActions can't coexist. I mean, if I want to use this like it's described above. When I click on the first Text or on the second the screen reader will read that text instead of selecting the entire View, which is wrong because the accessible prop is set to true
React Native version:
We are using 0.61.5
Steps To Reproduce
Those are explained above
Expected Results
The expected result is that both props can coexist and everything works as it should. Those Text shouldn't be accessibles based on Docs.
| :warning: | Using Old Version |
|---|---|
| :information_source: | It looks like you are using an older version of React Native. Please upgrade to the latest version, and verify if the issue persists. If it does not, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the current release. |
Hi @felire thanks for the issue. Sorry you're having trouble, could you verify this occurs on the latest version?
@safaiyeh The bug is still happening on the latest version of RN.
Tested on 0.63.2
hi, this is also happening with in version 0.63.2
after passing accessibilityActions prop to the view I become able to select its children elements, even after setting
accessible={true} in the parent view
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
This issue should be resolved by #30851 once that issue is closed as part of the Improved React Native Accessibility Project
a solution, as done with Text onPress and onLongPress, is setting focusable={true} when prop accessibilityAction != null. I will test it and prepare a PR in the future.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.