Skip to content
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

accessibilityState "disabled" can NOT be changed after being set to its initial value #30246

Closed
palexs opened this issue Oct 26, 2020 · 8 comments

Comments

@palexs
Copy link

palexs commented Oct 26, 2020

Description

If accessibilityState prop is set to "disabled" it can not be changed by setting accessibilityState to empty object/null or to false, e.g. { disabled: false }.

React Native version:

System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
    Memory: 594.19 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.4.0 - /usr/local/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5977832
    Xcode: 11.4/11E146 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5 
  npmGlobalPackages:
    react-native-cli: 2.0.1

Snack, code example, screenshot, or link to a repository:

Whenever this.state.disabled changes its value from false to true and vise versa the acessibilityState still keeps its initial value and does not change accordingly.

<TouchableHighlight
    accessible
    accessibilityRole={'button'}
    accessibilityLabel={'Tap me'}
    accessibilityState={{ disabled: this.state.disabled }}
    activeOpacity={0.6}
    disabled={this.state.disabled}
    onPress={this.onPress}
>
    <Text>{'Tap Me'}</Text>
</TouchableHighlight>

Miscellaneous

Additionally, it seems like changes introduced in Accessibility API in RN 0.61 (deprecation of accessibilityTraits and accessibilityComponentType, accessibilityStates -> accessibilityState) have made #21122 reproducible again.

Providing key={new Date()} to a component helps to flip its accessibilityState "disabled" value.

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. and removed Needs: Triage 🔍 labels Oct 26, 2020
@github-actions
Copy link

⚠️ Missing Environment Information
ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

@palexs palexs changed the title accessibilityState "disabled" can NOT be changed after being set to initial value accessibilityState "disabled" can NOT be changed after being set to its initial value Oct 26, 2020
@react-native-bot react-native-bot removed the Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. label Oct 26, 2020
@palexs
Copy link
Author

palexs commented Oct 26, 2020

@hramos Could you have a look, please?

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Oct 26, 2020
@safaiyeh safaiyeh added Accessibility Component: TouchableHighlight Newer Patch Available and removed Needs: Attention Issues where the author has responded to feedback. labels Oct 26, 2020
@github-actions
Copy link

⚠️ Using Old Version
ℹ️ 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.

@safaiyeh
Copy link
Contributor

Hello @palexs, couple things. Could you verify this occurs on the latest version and provide that repro?

@hramos
Copy link
Contributor

hramos commented Oct 27, 2020

Just a quick note, @palexs, please avoid pinging me on individual issues especially if they were just opened. We have a issue triage process in place and folks will look at each issue in order. Thanks!

@github-actions
Copy link

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 28, 2021
@github-actions github-actions bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 12, 2023
@github-actions
Copy link

github-actions bot commented May 6, 2023

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label May 6, 2023
@github-actions
Copy link

This issue was closed because the author hasn't provided the requested feedback after 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants