Skip to content

Commit

Permalink
Fix issue with modal content buttons not responding on some Android d…
Browse files Browse the repository at this point in the history
…evices

#208

The solution is to decrease DraggableView component PanResponder on touch start sensitivity https://stackoverflow.com/a/52609793
  • Loading branch information
serhiipalash committed Dec 29, 2019
1 parent 4d7bd2e commit c57075e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/DraggableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ export default class DraggableView extends Component<Props> {
}

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);
Expand Down

0 comments on commit c57075e

Please sign in to comment.