Socket
Socket
Sign inDemoInstall

react-touch-events

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.0.4

27

lib/index.js

@@ -41,3 +41,3 @@ "use strict";

handleClick: function handleClick() {
if (!this.usingTouch && this.props.onPoint) {
if (!this.usingTouch && this.props.onTap) {
this.props.onTap();

@@ -90,16 +90,19 @@ }

if (!this.touchMoved && this.props.onTap) {
this.props.onTap(event);
} else if (!this.swipeOutBounded && this.props.onSwipe) {
if (!this.touchMoved) {
if (this.props.onTap) {
this.props.onTap(event);
}
} else if (!this.swipeOutBounded) {
if (this.props.onSwipe) {
var swipeOutBounded = this.props.swipeTolerance,
direction;
var swipeOutBounded = this.props.swipeTolerance,
direction;
if (Math.abs(this.startX - this.currentX) < swipeOutBounded) {
direction = this.startY > this.currentY ? "top" : "bottom";
} else {
direction = this.startX > this.currentX ? "left" : "right";
}
if (Math.abs(this.startX - this.currentX) < swipeOutBounded) {
direction = this.startY > this.currentY ? "top" : "bottom";
} else {
direction = this.startX > this.currentX ? "left" : "right";
this.props.onSwipe(direction, event);
}
this.props.onSwipe(direction, event);
}

@@ -106,0 +109,0 @@ },

{
"name": "react-touch-events",
"version": "1.0.3",
"version": "1.0.4",
"description": "Enable tap / swipe events for react",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -1,5 +0,13 @@

# react-touch-events
# react-touch-events [![](https://img.shields.io/npm/v/react-touch-events.svg)](https://www.npmjs.com/package/react-touch-events)
Enable tap / swipe events for react
## Install
Use `npm`
```shell
npm i -S react-touch-events
```
## Usage

@@ -66,2 +74,26 @@

}
```
```
## LICENSE
MIT License
Copyright (c) 2016 Jerry Bendy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc