Skip to content

[iOS] A Pressable with a relation prop never calls onPressOut when it is disabled under the finger #4630

Open

Description

@YevheniiKotyrlo

Description

On iOS, a Pressable with a relation prop (simultaneousWith, requireToFail or block), which renders its state-machine implementation, calls onPressIn and never onPressOut when it is disabled while a finger holds it. Since #4501 the button cancels the press at that moment so that onPressOut fires without onPress, and the default Pressable and LegacyPressable do that.

The native gesture's onFinalize arrives before the long press's onTouchesCancel, so handleFinalize clears the press and handlePressOut returns early. LegacyPressable skips handleFinalize there on iOS for this order (#3777). Dragged away inside a scroll view, the same Pressable presses out, as the touch cancel arrives first there.

Steps to reproduce

  1. Render the Gist's component on an iOS device.
  2. Hold the first box until it greys out, 300 ms into the press, then lift: the log shows relation prop: onPressIn and no onPressOut.
  3. Do the same with the other two boxes: each logs onPressIn and onPressOut.

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/YevheniiKotyrlo/1c678fe68ed06ed45f3d1546fb55abf3

Gesture Handler version

main at 40ac206; 3.4.0 has the same code

React Native version

0.88.0

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Using Expo Prebuild or an Expo development build

Build type

Release mode

Device

Real device

Device model

iPad Pro 12.9-inch (4th generation), iPadOS 27.0.1

Acknowledgements

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: iOSThis issue is specific to iOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions