pietile-carousel
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -59,3 +59,5 @@ "use strict"; | ||
}); | ||
var containerStyle = __assign(__assign({}, style), { overflow: 'hidden' }); | ||
var containerStyle = __assign(__assign({}, style), { overflow: 'hidden', | ||
// https://github.com/framer/motion/issues/281 | ||
touchAction: 'pan-y' }); | ||
var transform = framer_motion_1.useMotionTemplate(templateObject_1 || (templateObject_1 = __makeTemplateObject(["translateX(-", "%)"], ["translateX(-", "%)"])), translate); | ||
@@ -62,0 +64,0 @@ var sliderStyle = { |
@@ -20,2 +20,6 @@ "use strict"; | ||
}); })[0]; | ||
var onTouchMove = react_1.useCallback(function (event) { | ||
// Prevent vertical scroll on mobile | ||
event.preventDefault(); | ||
}, []); | ||
var onPanStart = react_1.useCallback(function () { | ||
@@ -25,3 +29,4 @@ initial.dragging = true; | ||
initial.itemWidth = calcItemWidth(ref, count, margin); | ||
}, [ref, count, index, initial, margin]); | ||
document.documentElement.addEventListener('touchmove', onTouchMove, { passive: false }); | ||
}, [ref, count, index, initial, margin, onTouchMove]); | ||
var onPan = react_1.useCallback(function (_, info) { | ||
@@ -52,3 +57,4 @@ var newIndex = initial.index - info.offset.x / initial.itemWidth; | ||
utils_1.animateSpring(index, newIndex); | ||
}, [index, initial]); | ||
document.documentElement.removeEventListener('touchmove', onTouchMove); | ||
}, [index, initial, onTouchMove]); | ||
return react_1.useMemo(function () { return ({ | ||
@@ -55,0 +61,0 @@ onPanStart: onPanStart, |
{ | ||
"name": "pietile-carousel", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "React Carousel", | ||
@@ -30,5 +30,5 @@ "keywords": [ | ||
"@typescript-eslint/parser": "^4.0.0", | ||
"eslint": "~7.23.0", | ||
"eslint": "~7.28.0", | ||
"eslint-config-airbnb": "~18.2.0", | ||
"eslint-config-prettier": "~8.1.0", | ||
"eslint-config-prettier": "~8.3.0", | ||
"eslint-plugin-import": "^2.18.0", | ||
@@ -43,5 +43,4 @@ "eslint-plugin-jsx-a11y": "^6.2.3", | ||
"import-sort-style-pietile": "~1.2.0", | ||
"microbundle": "~0.13.0", | ||
"rimraf": "~3.0.0", | ||
"typescript": "~4.2.0" | ||
"typescript": "~4.3.0" | ||
}, | ||
@@ -48,0 +47,0 @@ "repository": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
18
440
0
23619
21