From 56fae39ec6dd580d9cbedeec588552469be00545 Mon Sep 17 00:00:00 2001 From: yigitfindikli Date: Tue, 7 Apr 2020 13:38:17 +0300 Subject: [PATCH] Fixed #264 - Carousel - Button inside carousel-item is not clickable in mobile phones --- src/components/carousel/Carousel.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/carousel/Carousel.vue b/src/components/carousel/Carousel.vue index ac2cbc58d..ceb9bb366 100644 --- a/src/components/carousel/Carousel.vue +++ b/src/components/carousel/Carousel.vue @@ -106,7 +106,8 @@ export default { d_page: this.page, totalShiftedItems: this.page * this.numScroll * -1, allowAutoplay : !!this.autoplayInterval, - d_circular : this.circular || this.allowAutoplay + d_circular : this.circular || this.allowAutoplay, + swipeThreshold: 20 } }, isRemainingItemsAdded: false, @@ -281,11 +282,13 @@ export default { } }, changePageOnTouch(e, diff) { - if (diff < 0) { // left - this.navForward(e); - } - else { // right - this.navBackward(e); + if (Math.abs(diff) > this.swipeThreshold) { + if (diff < 0) { // left + this.navForward(e); + } + else { // right + this.navBackward(e); + } } }, bindDocumentListeners() {