react-swipeable
Advanced tools
Comparing version 3.3.1 to 3.4.0
@@ -0,1 +1,5 @@ | ||
# 3.4.0 | ||
* Add preventDefault while swiping when props `onSwipedLeft`, `onSwipedRight`, `onSwipedUp`, and `onSwipedDown` are present. See #21 and #37 for more info. | ||
# 3.3.0 | ||
@@ -2,0 +6,0 @@ |
@@ -95,9 +95,9 @@ 'use strict'; | ||
if (pos.deltaX > 0) { | ||
if (this.props.onSwipingLeft) { | ||
this.props.onSwipingLeft(e, pos.absX); | ||
if (this.props.onSwipingLeft || this.props.onSwipedLeft) { | ||
this.props.onSwipingLeft && this.props.onSwipingLeft(e, pos.absX); | ||
cancelPageSwipe = true; | ||
} | ||
} else { | ||
if (this.props.onSwipingRight) { | ||
this.props.onSwipingRight(e, pos.absX); | ||
if (this.props.onSwipingRight || this.props.onSwipedRight) { | ||
this.props.onSwipingRight && this.props.onSwipingRight(e, pos.absX); | ||
cancelPageSwipe = true; | ||
@@ -108,9 +108,9 @@ } | ||
if (pos.deltaY > 0) { | ||
if (this.props.onSwipingUp) { | ||
this.props.onSwipingUp(e, pos.absY); | ||
if (this.props.onSwipingUp || this.props.onSwipedUp) { | ||
this.props.onSwipingUp && this.props.onSwipingUp(e, pos.absY); | ||
cancelPageSwipe = true; | ||
} | ||
} else { | ||
if (this.props.onSwipingDown) { | ||
this.props.onSwipingDown(e, pos.absY); | ||
if (this.props.onSwipingDown || this.props.onSwipedDown) { | ||
this.props.onSwipingDown && this.props.onSwipingDown(e, pos.absY); | ||
cancelPageSwipe = true; | ||
@@ -117,0 +117,0 @@ } |
{ | ||
"name": "react-swipeable", | ||
"version": "3.3.1", | ||
"version": "3.4.0", | ||
"description": "Swipe bindings for react", | ||
@@ -5,0 +5,0 @@ "main": "lib/Swipeable.js", |
@@ -1,4 +0,5 @@ | ||
# Swipeable | ||
# Swipeable | ||
[http://dogfessional.github.io/react-swipeable/](http://dogfessional.github.io/react-swipeable/) | ||
## Install | ||
### Install | ||
@@ -9,3 +10,3 @@ ```console | ||
## Use | ||
### Use | ||
@@ -39,7 +40,4 @@ ```js | ||
#### Examples: | ||
[http://dogfessional.github.io/react-swipeable/](http://dogfessional.github.io/react-swipeable/) | ||
## Props | ||
# Props | ||
**None of the props are required.** | ||
@@ -92,4 +90,4 @@ `onSwiping`, `onSwipingUp`, `onSwipingRight`, `onSwipingDown`, `onSwipingLeft`, calls back with the event | ||
# License | ||
## License | ||
MIT |
@@ -89,9 +89,9 @@ const React = require('react') | ||
if (pos.deltaX > 0) { | ||
if (this.props.onSwipingLeft) { | ||
this.props.onSwipingLeft(e, pos.absX) | ||
if (this.props.onSwipingLeft || this.props.onSwipedLeft) { | ||
this.props.onSwipingLeft && this.props.onSwipingLeft(e, pos.absX) | ||
cancelPageSwipe = true | ||
} | ||
} else { | ||
if (this.props.onSwipingRight) { | ||
this.props.onSwipingRight(e, pos.absX) | ||
if (this.props.onSwipingRight || this.props.onSwipedRight) { | ||
this.props.onSwipingRight && this.props.onSwipingRight(e, pos.absX) | ||
cancelPageSwipe = true | ||
@@ -102,9 +102,9 @@ } | ||
if (pos.deltaY > 0) { | ||
if (this.props.onSwipingUp) { | ||
this.props.onSwipingUp(e, pos.absY) | ||
if (this.props.onSwipingUp || this.props.onSwipedUp) { | ||
this.props.onSwipingUp && this.props.onSwipingUp(e, pos.absY) | ||
cancelPageSwipe = true | ||
} | ||
} else { | ||
if (this.props.onSwipingDown) { | ||
this.props.onSwipingDown(e, pos.absY) | ||
if (this.props.onSwipingDown || this.props.onSwipedDown) { | ||
this.props.onSwipingDown && this.props.onSwipingDown(e, pos.absY) | ||
cancelPageSwipe = true | ||
@@ -111,0 +111,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14706
91