Repository navigation
fix(android): respect pointer events on gesture root views - #4565
Conversation
|
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
📝 Summary
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly summarizes the main change: Android gesture root views now respect the pointerEvents prop. |
| 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. |
- Autopilot · 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.
Comment @coderabbitai help to get the list of available commands.
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!
m-bert
left a comment
There was a problem hiding this comment.
Hi @huytdps13400! I took the liberty of modifying this PR, hope you don't mind! 😅
Thank you again!
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.