From 8f6119a5d110ced0df2f0b51367ebbdab09bdce1 Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Wed, 3 Apr 2024 09:40:55 +1300 Subject: [PATCH] =?UTF-8?q?Fix=20#5320=20=E2=80=93=20Carousel=20blocking?= =?UTF-8?q?=20touch=20scroll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/lib/carousel/Carousel.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/lib/carousel/Carousel.vue b/components/lib/carousel/Carousel.vue index 6c7a923a1..a1e682290 100755 --- a/components/lib/carousel/Carousel.vue +++ b/components/lib/carousel/Carousel.vue @@ -409,7 +409,12 @@ export default { }; }, onTouchMove(e) { - if (e.cancelable) { + const touchobj = e.changedTouches[0]; + const diff = this.isVertical() + ? touchobj.pageY - this.startPos.y + : touchobj.pageX - this.startPos.x; + + if (Math.abs(diff) > this.swipeThreshold && e.cancelable) { e.preventDefault(); } },