[iOS] Fix manualActivation being ignored after a config update mid-gesture - #4520
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe Apple gesture handler now synchronizes the manual activation recognizer after configuration updates and manual activation changes. Configuration reset assigns the flag directly, while recognizer creation and removal use centralized synchronization logic. ChangesManual activation lifecycle
Suggested reviewers: Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The configuration update now preserves the manual activation behavior without an identified merge-blocking risk. 🚥 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 |
manualActivation being ignored after a config update mid-gesture
There was a problem hiding this comment.
🟢 Approval recommended
The activation blocker is preserved and synchronized correctly across configuration updates.
Pull request overview
Fixes iOS manualActivation being lost during mid-gesture configuration updates.
Changes:
- Preserves the activation blocker during config resets.
- Reconciles the blocker after applying configuration.
File summaries
| File | Description |
|---|---|
packages/react-native-gesture-handler/apple/RNGestureHandler.mm |
Updates manual activation reset and blocker synchronization. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
On iOS a handler with
manualActivation: trueactivates on its own if its config is updated mid-gesture. Any re-render during the gesture triggers that, since the config is re-sent on every render.setConfig:runsresetConfigbeforeupdateConfig:, andresetConfigwent through themanualActivationsetter, which removed theRNManualActivationRecognizerfrom the view.UIKitcancels a recognizer removed mid-touch, so the failure requirement it imposed on the handler was lost and the new blocker created byupdateConfig:never saw the touch.resetConfignow only clears the flag and the blocker is reconciled once after the config is applied, only when its presence no longer matches the flag. Android and web already reset values only.Test plan
Repro