Skip to content

[iOS] Don't iterate to root while resolving recognizer#4202

Merged
j-piasecki merged 1 commit into
mainfrom
@jpiasecki/add-return-condition
May 27, 2026
Merged

[iOS] Don't iterate to root while resolving recognizer#4202
j-piasecki merged 1 commit into
mainfrom
@jpiasecki/add-return-condition

Conversation

@j-piasecki
Copy link
Copy Markdown
Member

Description

The updated loop in #4199 didn't accurately represent the semantics from the old arch. It didn't stop on the views managed by React Native, instead iterating to the root of the hierarchy.

Test plan

Checked that it doesn't regress #4199

Copilot AI review requested due to automatic review settings May 27, 2026 14:15
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

This PR adjusts iOS gesture-handler lookup logic to avoid traversing all the way to the root view when trying to resolve a UIGestureRecognizer to an RNGestureHandler, restoring the “stop at React Native–managed views” semantics that existed in the old architecture.

Changes:

  • Update findGestureHandlerByRecognizer: to walk superviews looking for an RNDummyGestureRecognizer, but stop once a React Native Fabric-managed view (RCTViewComponentView) is reached.
  • Avoid local-variable shadowing by renaming the inner loop variable from recognizer to candidateRecognizer.

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

@j-piasecki j-piasecki merged commit fba4dcc into main May 27, 2026
4 checks passed
@j-piasecki j-piasecki deleted the @jpiasecki/add-return-condition branch May 27, 2026 14:19
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