Socket
Socket
Sign inDemoInstall

react-easy-swipe

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-easy-swipe - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

44

lib/react-swipe.js

@@ -19,2 +19,3 @@ (function (global, factory) {

});
exports.setHasSupportToCaptureOption = setHasSupportToCaptureOption;

@@ -79,2 +80,19 @@ var _react2 = _interopRequireDefault(_react);

var supportsCaptureOption = false;
function setHasSupportToCaptureOption(hasSupport) {
supportsCaptureOption = hasSupport;
}
try {
addEventListener("test", null, Object.defineProperty({}, 'capture', { get: function get() {
setHasSupportToCaptureOption(true);
} }));
} catch (e) {}
function getSafeEventHandlerOpts() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { capture: true };
return supportsCaptureOption ? options : options.capture;
}
/**

@@ -125,2 +143,22 @@ * [getPosition returns a position element that works for mouse or touch events]

_createClass(ReactSwipe, [{
key: 'componentDidMount',
value: function componentDidMount() {
if (this.swiper) {
this.swiper.addEventListener('touchmove', this._handleSwipeMove, getSafeEventHandlerOpts({
capture: true,
passive: false
}));
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
if (this.swiper) {
this.swiper.removeEventListener('touchmove', this._handleSwipeMove, getSafeEventHandlerOpts({
capture: true,
passive: false
}));
}
}
}, {
key: '_onMouseDown',

@@ -217,7 +255,11 @@ value: function _onMouseDown(event) {

value: function render() {
var _this2 = this;
return _react2.default.createElement(
this.props.tagName,
{
ref: function ref(node) {
return _this2.swiper = node;
},
onMouseDown: this._onMouseDown,
onTouchMove: this._handleSwipeMove,
onTouchStart: this._handleSwipeStart,

@@ -224,0 +266,0 @@ onTouchEnd: this._handleSwipeEnd,

2

package.json
{
"name": "react-easy-swipe",
"version": "0.0.11",
"version": "0.0.12",
"description": "React easy swipe - Easy handler for common touch operations",

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

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