react-spring-lightbox
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -457,11 +457,6 @@ 'use strict'; | ||
yDir = _ref2$direction[1], | ||
ctrlKey = _ref2.ctrlKey, | ||
cancel = _ref2.cancel; | ||
ctrlKey = _ref2.ctrlKey; | ||
// Disable drag if Image has been zoomed in to allow for panning | ||
if (ctrlKey || disableDrag || velocity === 0) { | ||
cancel(); | ||
return; | ||
} | ||
if (ctrlKey || disableDrag || velocity === 0) return; | ||
var draggedFarEnough = distance > pageWidth / 4; | ||
@@ -471,5 +466,3 @@ var draggedFastEnough = velocity > 1 && distance <= pageWidth / 4; // Handle next/prev image from valid drag | ||
if (draggedFarEnough || draggedFastEnough) { | ||
var goToIndex = clamp(currentIndex + (xDir + yDir > 0 ? -1 : 1), 0, images.length - 1); // Cancel gesture animation | ||
cancel(); | ||
var goToIndex = clamp(currentIndex + (xDir + yDir > 0 ? -1 : 1), 0, images.length - 1); | ||
if (goToIndex > currentIndex) onNext(); | ||
@@ -480,9 +473,3 @@ if (goToIndex < currentIndex) onPrev(); | ||
}); | ||
return; | ||
} // Update page x-coordinates from wheel | ||
set(function (i) { | ||
return getPagePositions(i, true, -distance); | ||
}); | ||
} | ||
}, | ||
@@ -489,0 +476,0 @@ onWheelEnd: function onWheelEnd() { |
@@ -452,11 +452,6 @@ import React, { useEffect, useState, useRef } from 'react'; | ||
yDir = _ref2$direction[1], | ||
ctrlKey = _ref2.ctrlKey, | ||
cancel = _ref2.cancel; | ||
ctrlKey = _ref2.ctrlKey; | ||
// Disable drag if Image has been zoomed in to allow for panning | ||
if (ctrlKey || disableDrag || velocity === 0) { | ||
cancel(); | ||
return; | ||
} | ||
if (ctrlKey || disableDrag || velocity === 0) return; | ||
var draggedFarEnough = distance > pageWidth / 4; | ||
@@ -466,5 +461,3 @@ var draggedFastEnough = velocity > 1 && distance <= pageWidth / 4; // Handle next/prev image from valid drag | ||
if (draggedFarEnough || draggedFastEnough) { | ||
var goToIndex = clamp(currentIndex + (xDir + yDir > 0 ? -1 : 1), 0, images.length - 1); // Cancel gesture animation | ||
cancel(); | ||
var goToIndex = clamp(currentIndex + (xDir + yDir > 0 ? -1 : 1), 0, images.length - 1); | ||
if (goToIndex > currentIndex) onNext(); | ||
@@ -475,9 +468,3 @@ if (goToIndex < currentIndex) onPrev(); | ||
}); | ||
return; | ||
} // Update page x-coordinates from wheel | ||
set(function (i) { | ||
return getPagePositions(i, true, -distance); | ||
}); | ||
} | ||
}, | ||
@@ -484,0 +471,0 @@ onWheelEnd: function onWheelEnd() { |
{ | ||
"name": "react-spring-lightbox", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "A flexible image gallery lightbox with native-feeling touch gestures and buttery smooth animations, built with react-spring.", | ||
@@ -5,0 +5,0 @@ "author": "Tim Ellenberger <timellenberger@gmail.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
166370
1571