From 13a7adb853b115f22b860697350f70da8eeb2462 Mon Sep 17 00:00:00 2001 From: yoavpagir Date: Wed, 29 Jul 2026 14:07:58 +0300 Subject: [PATCH] fix: Dialog - prevent open animation interruption by residual touch on Android (minDistance) A bottom Dialog/ActionSheet opened from a gesture-driven trigger (e.g. List.Item's TapGestureHandler firing onPress on END) can rest part-way open on Android: the residual touch leaks into the Dialog's own panGesture and drives `visibility` mid-open, interrupting the open spring. Adding a minDistance activation threshold to the pan prevents a near-static residual touch from engaging it, while drag-to-dismiss keeps working. Co-Authored-By: Claude Opus 4.8 --- .../react-native-ui-lib/src/components/dialog/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/react-native-ui-lib/src/components/dialog/index.tsx b/packages/react-native-ui-lib/src/components/dialog/index.tsx index 0e943f33cb..3293b99d9d 100644 --- a/packages/react-native-ui-lib/src/components/dialog/index.tsx +++ b/packages/react-native-ui-lib/src/components/dialog/index.tsx @@ -190,6 +190,12 @@ const Dialog = (props: DialogProps, ref: ForwardedRef) }; const panGesture = Gesture.Pan() + // MOBAPP-2994: require a deliberate drag before the pan engages. Without this, on Android/Fabric + // the residual touch stream from a gesture-handler trigger (e.g. List.Item's TapGestureHandler, + // which fires onPress on END while the touch is still settling) leaks into this freshly-mounted + // pan and drives `visibility` mid-open, interrupting the open spring so the sheet rests part-way. + // A plain touchable trigger (Button) lifts cleanly before the modal mounts and is unaffected. + .minDistance(10) .onStart(event => { initialTranslation.value = getTranslationReverseInterpolation(isVertical ? event.translationY : event.translationX) - visibility.value;