Skip to content

Commit

Permalink
Fix iOS touchReleaseOnEdges
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Nov 28, 2017
1 parent 42bec81 commit 628a048
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/core/events/onTouchMove.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ export default function (event) {
if (swiper.isVertical()) {
// Vertical
if (
(touches.currentY < touches.startY && swiper.translate <= swiper.maxTranslate()) ||
(touches.currentY > touches.startY && swiper.translate >= swiper.minTranslate())
(pageY < touches.startY && swiper.translate <= swiper.maxTranslate()) ||
(pageY > touches.startY && swiper.translate >= swiper.minTranslate())
) {
data.isTouched = false;
data.isMoved = false;
return;
}
} else if (
(touches.currentX < touches.startX && swiper.translate <= swiper.maxTranslate()) ||
(touches.currentX > touches.startX && swiper.translate >= swiper.minTranslate())
(pageX < touches.startX && swiper.translate <= swiper.maxTranslate()) ||
(pageX > touches.startX && swiper.translate >= swiper.minTranslate())
) {
return;
}
Expand All @@ -58,8 +60,8 @@ export default function (event) {
}
if (e.targetTouches && e.targetTouches.length > 1) return;

touches.currentX = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
touches.currentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
touches.currentX = pageX;
touches.currentY = pageY;

const diffX = touches.currentX - touches.startX;
const diffY = touches.currentY - touches.startY;
Expand Down

0 comments on commit 628a048

Please sign in to comment.