Skip to content

[Web] Fix Pressable not calling onPress* callbacks#4124

Merged
m-bert merged 2 commits intomainfrom
@mbert/pressables-web
Apr 27, 2026
Merged

[Web] Fix Pressable not calling onPress* callbacks#4124
m-bert merged 2 commits intomainfrom
@mbert/pressables-web

Conversation

@m-bert
Copy link
Copy Markdown
Collaborator

@m-bert m-bert commented Apr 27, 2026

Description

#4108 introduced another condition for activation of Native gesture. Since Pressables use PureNativeButton, not RawButton, they do not meet this condition, hence they don't activate

Test plan

Pressables examples in expo-example

Copilot AI review requested due to automatic review settings April 27, 2026 10:02
@m-bert m-bert requested a review from j-piasecki April 27, 2026 10:05
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 web Pressable not firing onPress* callbacks by ensuring the underlying Native gesture activates immediately on web (matching the activation condition introduced in #4108).

Changes:

  • Set shouldActivateOnStart: Platform.OS === 'web' for the v3 Pressable native gesture.
  • Set .shouldActivateOnStart(Platform.OS === 'web') for the legacy Pressable Gesture.Native() instance.

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 Enables start-activation for the native gesture on web so Pressable can transition to ACTIVE and trigger callbacks.
packages/react-native-gesture-handler/src/components/Pressable/Pressable.tsx Applies the same start-activation behavior for the legacy Pressable implementation on web.

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

@m-bert m-bert merged commit 4b3f497 into main Apr 27, 2026
3 checks passed
@m-bert m-bert deleted the @mbert/pressables-web branch April 27, 2026 10:06
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