Skip to content

Commit 35495d6

Browse files
committed
#47 : Prevent swiping if swiping is false
1 parent 1dbccd2 commit 35495d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/Carousel/Carousel.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,19 @@
286286
287287
// gestures
288288
function handleSwipeStart() {
289+
if (!swiping) return
289290
_duration = 0
290291
}
291292
async function handleThreshold(event) {
293+
if (!swiping) return
292294
await directionFnDescription[event.detail.direction]()
293295
}
294296
function handleSwipeMove(event) {
297+
if (!swiping) return
295298
offset += event.detail.dx
296299
}
297300
function handleSwipeEnd() {
301+
if (!swiping) return
298302
showPage(currentPageIndex)
299303
}
300304
function handleFocused(event) {

0 commit comments

Comments
 (0)