diff --git a/dist/index.js b/dist/index.js index d4a976c5..a5f06fb7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -124,7 +124,8 @@ var Swipeout = (0, _createReactClass2.default)({ right: _propTypes2.default.array, scroll: _propTypes2.default.func, style: (_reactNative.ViewPropTypes || _reactNative.View.propTypes).style, - sensitivity: _propTypes2.default.number, + sensitivityX: _propTypes2.default.number, + sensitivityY: _propTypes2.default.number, buttonWidth: _propTypes2.default.number, disabled: _propTypes2.default.bool }, @@ -134,7 +135,8 @@ var Swipeout = (0, _createReactClass2.default)({ disabled: false, rowID: -1, sectionID: -1, - sensitivity: 50 + sensitivityX: 50, + sensitivityY: 50 }; }, @@ -165,7 +167,7 @@ var Swipeout = (0, _createReactClass2.default)({ return _this.state.openedLeft || _this.state.openedRight; }, onMoveShouldSetPanResponderCapture: function onMoveShouldSetPanResponderCapture(event, gestureState) { - return Math.abs(gestureState.dx) > _this.props.sensitivity && Math.abs(gestureState.dy) <= _this.props.sensitivity; + return Math.abs(gestureState.dx) > _this.props.sensitivityX && Math.abs(gestureState.dy) <= _this.props.sensitivityY; }, onPanResponderGrant: this._handlePanResponderGrant, onPanResponderMove: this._handlePanResponderMove, @@ -190,11 +192,11 @@ var Swipeout = (0, _createReactClass2.default)({ var _this2 = this; if (this.props.disabled) return; - if (!this.state.openedLeft && !this.state.openedRight) { - this._callOnOpen(); - } else { - this._callOnClose(); - } + // if (!this.state.openedLeft && !this.state.openedRight) { + // this._callOnOpen(); + // } else { + // this._callOnClose(); + // } this.refs.swipeoutContent.measure(function (ox, oy, width, height) { var buttonWidth = _this2.props.buttonWidth || width / 5; _this2.setState({ diff --git a/index.d.ts b/index.d.ts index e8364b7b..9a35038b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -23,7 +23,8 @@ declare module 'react-native-swipeout' { right?: SwipeoutButtonProperties[]; scroll?(scrollEnabled: boolean): void; style?: Object; - sensitivity?: number; + sensitivityX?: number; + sensitivityY?: number; buttonWidth?: number; rowId?: number; sectionId?: number;