From 35495d6f9169c4c19aef9518807d4a318b0fe09e Mon Sep 17 00:00:00 2001 From: Vadim Date: Sat, 24 Jul 2021 15:21:30 +0300 Subject: [PATCH] #47 : Prevent swiping if swiping is false --- src/components/Carousel/Carousel.svelte | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/Carousel/Carousel.svelte b/src/components/Carousel/Carousel.svelte index e5f09ec..43c35af 100644 --- a/src/components/Carousel/Carousel.svelte +++ b/src/components/Carousel/Carousel.svelte @@ -286,15 +286,19 @@ // gestures function handleSwipeStart() { + if (!swiping) return _duration = 0 } async function handleThreshold(event) { + if (!swiping) return await directionFnDescription[event.detail.direction]() } function handleSwipeMove(event) { + if (!swiping) return offset += event.detail.dx } function handleSwipeEnd() { + if (!swiping) return showPage(currentPageIndex) } function handleFocused(event) {