react-swipeable
Advanced tools
+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 @@ |
+8
-8
@@ -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 @@ } |
+1
-1
| { | ||
| "name": "react-swipeable", | ||
| "version": "3.3.1", | ||
| "version": "3.4.0", | ||
| "description": "Swipe bindings for react", | ||
@@ -5,0 +5,0 @@ "main": "lib/Swipeable.js", |
+6
-8
@@ -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 |
+8
-8
@@ -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 @@ } |
14706
4.19%91
-2.15%