Skip to content

TouchableOpacity remains disabled after attempted click and state change from TextInput #2730

Closed
@nathan-ahn

Description

@nathan-ahn

Description

On web, when controlling the disabled state of a GH TouchableOpacity using a TextInput component (specifically onChangeText), the button becomes stuck as disabled after attempting a click. This issue only occurs after trying to click on the TouchableOpacity while it's disabled, and only when updating state using TextInput's onChangeText (There's a chance it's affected by other events, but I haven't tested). TouchableOpacity works as intended when using another Pressable to change the disabled state.

When stuck as disabled, onPress doesn't fire and the opacity doesn't change. This behavior is inconsistent with RN's original TouchableOpacity which correctly re-enables the TouchableOpacity after a text change.

Steps to reproduce

  1. Attempt to click the disabled TouchableOpacity
  2. Edit the text input (to trigger onChangeText)
  3. Attempt to click the TouchableOpacity (which should be enabled)

Snack or a link to a repository

https://snack.expo.dev/@nathan_ahn/gesture-handler-textinput-disabled-bug

Gesture Handler version

2.14.1

React Native version

0.72.4

Platforms

Web

JavaScript runtime

None

Workflow

Expo managed workflow

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions