Repository navigation
fix(android): respect pointer events on gesture root views - #4565
huytdps13400 wants to merge 1 commit into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe Android gesture-handler root view now accepts a ChangesRoot Pointer Events
Suggested reviewers: Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable issue is established for the Android pointer-events change or its example screen. The change is ready to merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The inspected change affects touch routing within an application view, without introducing a new privileged operation. No concrete security regression was identified, but prop removal and updates during active gestures remain incompletely verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix follows existing detector-manager patterns and includes a suitable manual regression screen.
Review effort: Balanced
Findings: None
What changed in this PR
Ensures Android gesture root views correctly honor React Native pointerEvents semantics.
Changes:
- Declares and forwards
pointerEventsthrough native codegen. - Applies parsed pointer-event modes to the Android root view.
- Adds an interactive v3 API comparison screen.
| File | Description |
|---|---|
RNGestureHandlerRootViewNativeComponent.ts |
Adds the codegen prop declaration. |
RNGestureHandlerRootViewManager.kt |
Forwards the prop to the native view. |
PointerEventsRepro.tsx |
Demonstrates all pointer-event modes. |
App.tsx |
Registers the new example screen. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
b9c337c to
ecb3e5b
Compare
m-bert
left a comment
There was a problem hiding this comment.
Hi @huytdps13400 👋
Thank you for this PR ❤️ It looks good, the only thing I'd like you to change is to remove the example - in this case a code change is enough.
Let me know when it's ready!
Description
On Android,
GestureHandlerRootViewacceptspointerEventsthroughViewProps, but its generated manager delegate never forwards that prop. A nested root withbox-noneintercepts taps in its empty area;nonestill allows child Pressables and v3 gestures to activate.Declare the prop explicitly in the native spec and forward it to
ReactViewGroup.pointerEvents, following the existing detector/button managers. Add a basic-example screen comparing a nested gesture root with a plain View across all pointer-event modes.This addresses the gesture-root blocker described in heroui-inc/heroui-native#490. The separate HeroUI wrapper behavior is outside this change.
Test plan
box-noneblocks the background where a plain View allows it;nonestill fires the child Pressable anduseTapGesturecallbacks.auto,none,box-only,box-none, and removing the prop on the same mounted view. Background, child Pressable, and v3 gesture counters match the expected behavior. Also verified the new screen through the example navigator.To reproduce: launch
apps/basic-example, advance to Root Pointer Events, and tap Empty side, Child press, and Child gesture. Switch modes without remounting; Use View provides the native View control.