From c57075e30769430ebad9fae35bfb3bb64d7f6f01 Mon Sep 17 00:00:00 2001 From: serhiipalash Date: Sun, 29 Dec 2019 19:16:22 +0200 Subject: [PATCH] Fix issue with modal content buttons not responding on some Android devices https://github.com/jacklam718/react-native-modals/issues/208 The solution is to decrease DraggableView component PanResponder on touch start sensitivity https://stackoverflow.com/a/52609793 --- src/components/DraggableView.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/DraggableView.js b/src/components/DraggableView.js index 11c36ad..bdc962a 100644 --- a/src/components/DraggableView.js +++ b/src/components/DraggableView.js @@ -138,9 +138,11 @@ export default class DraggableView extends Component { } panResponder = PanResponder.create({ - onMoveShouldSetPanResponder: (evt, gestureState) => ( - gestureState.dx !== 0 && gestureState.dy !== 0 - ), + onMoveShouldSetPanResponder: (evt, gestureState) => { + const { dx, dy } = gestureState + + return dx > 2 || dx < -2 || dy > 2 || dy < -2 + }, onStartShouldSetPanResponder: () => true, onPanResponderMove: (event, gestureState) => { const isVerticalSwipe = d => ['up', 'down'].includes(d);