Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-swipeable

Package Overview
Dependencies
Maintainers
2
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-swipeable - npm Package Compare versions

Comparing version 3.3.1 to 3.4.0

4

CHANGELOG.md

@@ -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 @@

16

lib/Swipeable.js

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc