@haroldtran/react-native-modals 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haroldtran/react-native-modals",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "React Native Modals Library for IOS & Android.",
5
5
  "main": "/src/index.tsx",
6
6
  "scripts": {
@@ -152,9 +152,10 @@ export default class DraggableView extends Component<Props> {
152
152
  }
153
153
 
154
154
  panResponder = PanResponder.create({
155
+ onStartShouldSetPanResponder: () => this.allowedDirections.length > 0,
155
156
  onMoveShouldSetPanResponder: (evt, gestureState) =>
156
- gestureState.dx !== 0 && gestureState.dy !== 0,
157
- onStartShouldSetPanResponder: () => true,
157
+ this.allowedDirections.length > 0 &&
158
+ (gestureState.dx !== 0 || gestureState.dy !== 0),
158
159
  onPanResponderMove: (event: any, gestureState: any) => {
159
160
  const isVerticalSwipe = (d: SwipeDirection | null) =>
160
161
  ["up", "down"].includes(d as string);