react-multi-carousel
Advanced tools
Comparing version 1.3.20 to 1.3.21
@@ -30,2 +30,3 @@ import * as React from "react"; | ||
isInThrottle?: boolean; | ||
initialY: number; | ||
constructor(props: CarouselProps); | ||
@@ -32,0 +33,0 @@ setIsInThrottle(isInThrottle?: boolean): void; |
@@ -66,2 +66,3 @@ "use strict"; | ||
_this.direction = ""; | ||
_this.initialY = 0; | ||
_this.isInThrottle = false; | ||
@@ -295,2 +296,3 @@ return _this; | ||
this.direction = ""; | ||
this.initialY = 0; | ||
}; | ||
@@ -303,5 +305,6 @@ Carousel.prototype.handleDown = function (e) { | ||
} | ||
var clientX = (e.touches ? e.touches[0] : e).clientX; | ||
var _a = e.touches ? e.touches[0] : e, clientX = _a.clientX, clientY = _a.clientY; | ||
this.onMove = true; | ||
this.initialPosition = clientX; | ||
this.initialY = clientY; | ||
this.lastPosition = clientX; | ||
@@ -315,3 +318,5 @@ this.isAnimationAllowed = false; | ||
} | ||
var clientX = (e.touches ? e.touches[0] : e).clientX; | ||
var _a = e.touches ? e.touches[0] : e, clientX = _a.clientX, clientY = _a.clientY; | ||
var diffX = this.initialPosition - clientX; | ||
var diffY = this.initialY - clientY; | ||
if (e.touches && this.autoPlay && this.props.autoPlay) { | ||
@@ -322,3 +327,6 @@ clearInterval(this.autoPlay); | ||
if (this.onMove) { | ||
var _a = utils_1.populateSlidesOnMouseTouchMove(this.state, this.props, this.initialPosition, this.lastPosition, clientX), direction = _a.direction, nextPosition = _a.nextPosition, canContinue = _a.canContinue; | ||
if (!(Math.abs(diffX) > Math.abs(diffY))) { | ||
return; | ||
} | ||
var _b = utils_1.populateSlidesOnMouseTouchMove(this.state, this.props, this.initialPosition, this.lastPosition, clientX), direction = _b.direction, nextPosition = _b.nextPosition, canContinue = _b.canContinue; | ||
if (direction) { | ||
@@ -325,0 +333,0 @@ this.direction = direction; |
{ | ||
"name": "react-multi-carousel", | ||
"private": false, | ||
"version": "1.3.20", | ||
"version": "1.3.21", | ||
"description": "Production-ready, lightweight fully customizable React carousel component that rocks supports multiple items and SSR(Server-side rendering) with typescript.", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
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
175561
1445