[General] Add failOffsetY prop to ReanimatedSwipeable - #4564
willheisenberg wants to merge 4 commits 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 (1)
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
WalkthroughReanimatedSwipeable now accepts an optional ChangesReanimatedSwipeable gesture configuration
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to This adds an optional vertical failure offset to ReanimatedSwipeable, and behavior is unchanged when the prop is omitted. No merge-blocking risk was identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change is small and opt-in. It uses the existing gesture pipeline without introducing new privileges or data access, and preserves configuration when the option is omitted. Platform-specific touch ownership after gesture failure remains 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
🟡 Changes recommended
The new gesture-configuration path lacks regression coverage.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds configurable vertical failure thresholds to ReanimatedSwipeable, preventing vertical list gestures from being intercepted.
Changes:
- Exposes and forwards
failOffsetY. - Documents supported values and pull-to-refresh usage.
| File | Description |
|---|---|
ReanimatedSwipeableProps.ts |
Defines the new prop. |
ReanimatedSwipeable.tsx |
Applies it to the pan gesture. |
reanimated_swipeable.mdx |
Documents the API. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Description
Adds an optional
failOffsetYprop toReanimatedSwipeableand forwards it to the internal pan gesture.So far the swipe pan was configured only with
activeOffsetX. Inside a vertical list withRefreshControlon Android, a slightly diagonal pull could start the native pull-to-refresh and then activate the swipe, which cancels the native touches.SwipeRefreshLayoutdoesn't retract onACTION_CANCEL, so the indicator stays half-pulled. WithfailOffsetY(e.g.[-8, 8]) the swipe fails once the finger moves vertically first, and horizontal swiping keeps working.The prop is only added to the pan config when set, so behavior without it is unchanged. Docs for
ReanimatedSwipeableare updated.Fixes #4563
Test plan
yarn ts-check,yarn lint:jsandyarn testinpackages/react-native-gesture-handlerpass.failOffsetYlight diagonal pulls on a row leave the refresh indicator stuck; withfailOffsetY={[-8, 8]}10 out of 10 such pulls behaved correctly, and swiping rows horizontally still works.