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

disabled TouchableHighlight still receives keyboard focus #8875

Closed
AgneLukoseviciute opened this issue Oct 20, 2021 · 1 comment · Fixed by #11278
Closed

disabled TouchableHighlight still receives keyboard focus #8875

AgneLukoseviciute opened this issue Oct 20, 2021 · 1 comment · Fixed by #11278
Assignees
Milestone

Comments

@AgneLukoseviciute
Copy link
Contributor

Problem Description

from: #8781

Disabled TouchableHighlight still receives keyboard focus if onPress is defined.

Steps To Reproduce

  1. Set disabled={true} and define an onPress handler for a TouchableHighlight component
  2. tab through and observe how it still receives keyboard focus
  3. vs if you remove the onPress it behaves as expected and no longer gets keyboard focus

Expected Results

No response

CLI version

6.1.0

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

      <View>
            <TouchableHighlight disabled={true} onPress={this._handlePress}>
              <Text>text within a disabled touchable</Text>
            </TouchableHighlight>
            <TouchableHighlight onPress={this._handlePress}>
              <Text>text within a disabled touchable</Text>
            </TouchableHighlight>
      </View>

The disabled TouchableHighlight still receives keyboard focus

@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Oct 20, 2021
@asklar asklar removed the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Oct 21, 2021
@asklar asklar added this to the Backlog milestone Oct 21, 2021
@AgneLukoseviciute AgneLukoseviciute self-assigned this Aug 23, 2022
@AgneLukoseviciute
Copy link
Contributor Author

explicitly setting focusable to false can be used as a workaround. I think we'll want to do something similar to #9840 so that when the disabled prop is set to true, we make the control not focusable/inaccessible. This will mimic the behavior in XAML

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