Skip to content

[Android] Check the overflow ancestor pass against the detector child's bounds - #4605

Merged
m-bert merged 1 commit into
mainfrom
@mbert/android-detector-overflow-child-bounds
Oct 16, 2026
Merged

m-bert merged 1 commit into
mainfrom
@mbert/android-detector-overflow-child-bounds

Conversation

@m-bert

@m-bert m-bert commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Since #4532 a native detector's frame is widened to cover its transformed child. The orchestrator already checks the detector's own handlers against the child's transform-aware bounds when the child didn't consume the touch (useChildBounds), so a translated-away child doesn't stay tappable over the area it vacated. The overflow pass right below that check still used the host frame. In an open ReanimatedSwipeable the widened host spans the whole row, so a tap on the action panel passed the "pointer inside the view" test, isViewOverflowingParent was true and extractAncestorHandlers recorded the row's pan and the list's scroll handler before the traversal reached the panel. ButtonViewGroup.shouldBeginWithRecordedHandlers then cancelled the button's handler at record time, so RectButton, Pressable and Touchable inside the panel never pressed. Whether a given open row was affected depended on whether a layout pass had run since opening, which is why it looked random.

The overflow pass now uses the same bounds as the handler check above it. For every view that isn't a single-child detector host nothing changes. For the host, a pointer over the vacated area skips the early ancestor recording; the ancestors still get recorded in the normal order as the traversal unwinds, since they contain the pointer themselves. Native touch delivery from #4532 is a shadow node change and isn't touched.

Fixes the action buttons of ReanimatedSwipeable rows on Android (regression from #4532, not in 3.3.0).

Test plan

Android emulator, expo-example, Reanimated Swipeable:

yarn lint:android passes.

Copilot AI balanced review requested due to automatic review settings October 16, 2026 15:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fc97fec4-a3f6-431a-9655-475e1e55b75d
📥 Commits

Reviewing files that changed from the base of the PR and between dff741a and 83a7c32.

📒 Files selected for processing: 1
  • packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Corrected gesture handling when checking transformed child bounds within a parent that allows overflow.

The overflow-parent check and ancestor-handler extraction now use the selected bounds view’s coordinates and dimensions, including when hit-testing uses a child’s transformed bounds.

Changes: Pointer Bounds Hit Testing

Layer / File(s) Summary
Use selected bounds for ancestor lookup
packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt
The overflow-parent check and ancestor-handler extraction now use the selected bounds view’s coordinates and dimensions.

Suggested reviewers: j-piasecki

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 83a7c

Using the selected bounds for ancestor lookup is reported to preserve row actions and transformed-child gestures while avoiding incorrect overflow handling. No concrete remaining regression is identified; merge after normal checks.

Pre-merge checks: Passed 3
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main Android change: applying the overflow ancestor check to the detector child's bounds.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review issues were identified.

0 open findings

🧠 Review effort: Lite

@m-bert
m-bert merged commit 0bbc5a3 into main Oct 16, 2026
5 checks passed
@m-bert
m-bert deleted the @mbert/android-detector-overflow-child-bounds branch October 16, 2026 15:30
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