Repository navigation
[Android] Reset the native DOWN flag for unmanaged buttons - #4590
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change extends the per-gesture reset to buttons without a managed handler, while preserving the existing managed-button event order. No actionable merge-blocking risk is established. Pre-merge checks |
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused state-reset relocation correctly addresses unmanaged buttons without altering managed-handler behavior.
0 open findings
What changed in this PR
Moves Android’s per-gesture native DOWN reset so unmanaged detector-attached buttons also receive correct cancellation behavior.
Changes:
- Resets
receivedNativeDownonSTATE_BEGANbefore the managed-handler guard. - Preserves managed button press-state handling.
| File | Description |
|---|---|
RNGestureHandlerButtonViewManager.kt |
Applies DOWN-state reset to managed and unmanaged buttons. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
ButtonViewGrouptracks whether the native dispatch delivered DOWN for the current gesture and resets it when the handler goes BEGAN. The reset sat behind themanagedHandlerTagguard, so it only ran for buttons that manage their own handler (Touchable,Pressable). A button attached through a detector, likeRectButtonwithuseNativeGesture, set the flag on its first touch and never cleared it. From then on the #4441 rule degraded to the mid-gesture check only, and a fling caught on such a button was not cancelled.The reset now runs before the guard, so every handler on the view gets the per-gesture rule. Since #4582 the detector rule already covers this case for detector-attached buttons, so there is no visible change today; this fixes the stale state so the hook's rule holds on its own.
Test plan
Repro