diff --git a/packages/react-native-ui-lib/jestSetup/jest-setup.js b/packages/react-native-ui-lib/jestSetup/jest-setup.js index 992dbe430d..57bae298da 100644 --- a/packages/react-native-ui-lib/jestSetup/jest-setup.js +++ b/packages/react-native-ui-lib/jestSetup/jest-setup.js @@ -79,6 +79,7 @@ jest.mock('react-native-gesture-handler', PanMock.onFinalize = getDefaultMockedHandler('onFinalize'); PanMock.activateAfterLongPress = getDefaultMockedHandler('activateAfterLongPress'); PanMock.enabled = getDefaultMockedHandler('enabled'); + PanMock.minDistance = getDefaultMockedHandler('minDistance'); PanMock.hitSlop = getDefaultMockedHandler('hitSlop'); PanMock.onTouchesMove = getDefaultMockedHandler('onTouchesMove'); PanMock.prepare = jest.fn(); 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..61fb23d615 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,13 @@ 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. + // 10dp is small enough to keep drag-to-dismiss responsive while ignoring near-static residual touches. + .minDistance(10) .onStart(event => { initialTranslation.value = getTranslationReverseInterpolation(isVertical ? event.translationY : event.translationX) - visibility.value;