Skip to content

Touchable with href can still be clicked when disabled is true #2298

Description

@rnike

The problem

Hello, I recently found out the props.disable of Touchable will not prevent it from clicking if props.href is provided, although it prevents the onPress event to be fired, but still will be navigated to the distination.

How to reproduce

Simplified test case: https://codesandbox.io/s/cocky-smoke-pl5kog

Steps to reproduce:

  1. render a TouchableOpacity or TouchableHighlight with props.href="https://github.com/" and props.disabled={true}
  2. click on the touchable

Expected behavior

Should not be navigated to "/" since the touchable is disabled

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): TBC
  • React (version): TBC
  • Browser: TBC

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughas: prSubject of a pull request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions