Skip to content

[iOS] Activate buttons on pointer up#4129

Merged
j-piasecki merged 4 commits intomainfrom
@jpiasecki/ios-activate-buttons-pointer-up
Apr 30, 2026
Merged

[iOS] Activate buttons on pointer up#4129
j-piasecki merged 4 commits intomainfrom
@jpiasecki/ios-activate-buttons-pointer-up

Conversation

@j-piasecki
Copy link
Copy Markdown
Member

Description

Changes the moment the ACTIVE event is dispatched on iOS from pointer down to pointer up, aligning it with Android and Web implementations.

Updates existing checks to account for this change.

Updates the v3 button implementation to do cleanup in onFinalize instead of onDeactivate - setup happens in onBegin, so there's no guarantee that onDeactivate will trigger.

Test plan

Tested existing examples, including legacy ones

Copilot AI review requested due to automatic review settings April 29, 2026 08:18
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

Adjusts button activation semantics on iOS to dispatch ACTIVE on pointer-up (to match Android/Web), and updates JS-side button/touchable logic to work with the new state timing.

Changes:

  • Moves v3 BaseButton cleanup/press dispatching from onDeactivate to onFinalize.
  • Updates legacy touchable/button state handling to treat BEGAN as “active” and to trigger press-in on BEGAN.
  • Updates iOS RNNativeViewGestureHandler to emit an ACTIVE update on touchUpInside before END.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/react-native-gesture-handler/src/v3/components/GestureButtons.tsx Moves press/cleanup to onFinalize for v3 buttons.
packages/react-native-gesture-handler/src/components/touchables/GenericTouchable.tsx Simplifies state transition trigger to always use State.BEGAN.
packages/react-native-gesture-handler/src/components/GestureButtons.tsx Treats BEGAN as active for legacy button active-state tracking.
packages/react-native-gesture-handler/apple/Handlers/RNNativeViewHandler.mm Emits an ACTIVE update on pointer-up-inside prior to END.

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

@j-piasecki j-piasecki requested a review from m-bert April 29, 2026 08:29
Comment thread packages/react-native-gesture-handler/src/components/GestureButtons.tsx Outdated
@j-piasecki j-piasecki merged commit dec475f into main Apr 30, 2026
6 checks passed
@j-piasecki j-piasecki deleted the @jpiasecki/ios-activate-buttons-pointer-up branch April 30, 2026 05:21
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