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

Focusable and accessible native states can get out of sync #10687

Closed
rozele opened this issue Oct 6, 2022 · 1 comment · Fixed by #10686
Closed

Focusable and accessible native states can get out of sync #10687

rozele opened this issue Oct 6, 2022 · 1 comment · Fixed by #10686

Comments

@rozele
Copy link
Collaborator

rozele commented Oct 6, 2022

Problem Description

If only focusable or accessible props change in a particular batch of updates to a View, we will not apply the mitigation here to ensure focusable and accessible states are kept in sync.

Steps To Reproduce

  1. Open the view.tsx example
  2. Update the example with the code in this gist.
  3. Play around with setting pressable, focusable, and accessible in various combinations.

Setting pressable to false, and then setting either focusable or accessible to false but not both puts the app in a bad state where narrator can get out of sync with keyboard focus.

See following bugs below:

  1. IsTabStop not disabled after setting accessible to false
  2. Is accessible not disabled after setting focusable to false

Expected Results

Based on #9840 and #10569, we should have the behavior described by the following pseudo-code:

if view is pressable:
  if view is not both focusable or accessible:
    view is not focusable and not accessible
  else:
    view is focusable and accessible
else:
  if view is focusable or accessible:
    view is focusable and accessible
  else:
    view is not focusable and not accessible

CLI version

npx react-native --version

Environment

npx react-native info

Target Platform Version

No response

Target Device(s)

No response

Visual Studio Version

No response

Build Configuration

No response

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

React.Native.Playground.Win32.2022-10-06.12-52-32.mp4
@rozele rozele added the bug label Oct 6, 2022
@ghost ghost added Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) Partner: Facebook labels Oct 6, 2022
@jonthysell
Copy link
Contributor

@chiaramooney can take a look at this?

@jonthysell jonthysell removed the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Oct 6, 2022
@jonthysell jonthysell added this to the 0.71 milestone Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants