react-native icon indicating copy to clipboard operation
react-native copied to clipboard

accessibilityActions is causing problems with accessible props (Android - accessibility)

Open felire opened this issue 5 years ago • 6 comments

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.

felire avatar Aug 20 '20 20:08 felire

: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.

github-actions[bot] avatar Aug 24 '20 05:08 github-actions[bot]

Hi @felire thanks for the issue. Sorry you're having trouble, could you verify this occurs on the latest version?

safaiyeh avatar Aug 24 '20 05:08 safaiyeh

@safaiyeh The bug is still happening on the latest version of RN.

Tested on 0.63.2

felire avatar Aug 27 '20 20:08 felire

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

vitorandrietta avatar Aug 27 '20 20:08 vitorandrietta

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.

stale[bot] avatar Dec 25 '20 19:12 stale[bot]

This issue should be resolved by #30851 once that issue is closed as part of the Improved React Native Accessibility Project

amarlette avatar Mar 18 '21 23:03 amarlette

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.

fabOnReact avatar Nov 28 '22 09:11 fabOnReact

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.

github-actions[bot] avatar Jun 29 '23 05:06 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jul 06 '23 05:07 github-actions[bot]