Skip to content

Nested Text inside Pressable behaves differently than the same components from RN #3640

@gigobyte

Description

@gigobyte

Description

When a Text with onPress is rendered inside a Pressable that has its own onPress, the behaviour differs from Pressable/Text from 'react-native'. Additionally, the bad behaviour itself differs between OSes:

  1. On iOS - only the Pressable onPress gets called
  2. On Android - both the Pressable and the Text onPress gets called

For reference, using RN components only the Text onPress gets called, which I consider the desided behaviour.

Steps to reproduce

  1. Run the code from the gist
  2. Press on "Inner" on the upper box - observe "RN: Inner onPress" get logged, which is the correct behaviour
  3. Press on "Inner" on the lower box - observe "RNGH: Pressable onPress" get logged, which is not the desired behaviour

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

https://gist.github.com/gigobyte/b20efeca86e28eed8f34a2f3b4f7c2af

Gesture Handler version

2.27.2

React Native version

0.79.0

Platforms

Android, iOS

JavaScript runtime

None

Workflow

None

Architecture

New Architecture (Fabric)

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions