Skip to content

[iOS] Fix LegacyPressable not emitting onPressOut#4121

Merged
j-piasecki merged 1 commit intomainfrom
@jpiasecki/fix-ios-pressable-stuck
Apr 27, 2026
Merged

[iOS] Fix LegacyPressable not emitting onPressOut#4121
j-piasecki merged 1 commit intomainfrom
@jpiasecki/fix-ios-pressable-stuck

Conversation

@j-piasecki
Copy link
Copy Markdown
Member

Description

Fixes the LegacyPressable on iOS getting stuck due to an unhandled NATIVE_START event. Updates the non-legacy implementation to also dispatch the NATIVE_START, which is now expected by the state machine.

Test plan

Before After
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-04-27.at.07.52.42.mov
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-04-27.at.07.52.29.mov

Copilot AI review requested due to automatic review settings April 27, 2026 06:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an iOS-specific LegacyPressable press lifecycle issue where onPressOut could fail to fire due to the state machine resetting on an unexpected NATIVE_START event, and keeps the v3 Pressable implementation aligned with the updated state machine expectations.

Changes:

  • Add NATIVE_START to the iOS Pressable state machine definition so the event no longer causes a reset mid-sequence.
  • Update v3 Pressable to dispatch NATIVE_START on iOS (still excluded on Android due to the existing hitSlop issue).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/react-native-gesture-handler/src/v3/components/Pressable.tsx Dispatches NATIVE_START for iOS to match the state machine’s expected event sequence.
packages/react-native-gesture-handler/src/components/Pressable/stateDefinitions.ts Updates iOS state sequence to include NATIVE_START, preventing iOS from getting stuck before FINALIZE.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@j-piasecki j-piasecki merged commit 8428d24 into main Apr 27, 2026
7 checks passed
@j-piasecki j-piasecki deleted the @jpiasecki/fix-ios-pressable-stuck branch April 27, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants