From 76500af658752520c6630d0ef99423090b11320b Mon Sep 17 00:00:00 2001 From: Rasmus Nielsen Date: Thu, 1 Oct 2020 10:17:40 +0200 Subject: [PATCH 1/2] fix glitchingg --- src/components/carousel/carousel.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/carousel/carousel.js b/src/components/carousel/carousel.js index 2e8e27bc697..d216528a9df 100644 --- a/src/components/carousel/carousel.js +++ b/src/components/carousel/carousel.js @@ -269,7 +269,10 @@ export const BCarousel = /*#__PURE__*/ Vue.extend({ // Don't change slide while transitioning, wait until transition is done if (this.isSliding) { // Schedule slide after sliding complete - this.$once('sliding-end', () => this.setSlide(slide, direction)) + this.$once('sliding-end', () => { + // Wrap in setTimeout to allow the slide to properly finish to avoid glitching + setTimeout(() => this.setSlide(slide, direction)) + }) return } this.direction = direction From ca0561a982757dd81faae9c5cdb1b81fed517fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Thu, 1 Oct 2020 11:19:06 +0200 Subject: [PATCH 2/2] Update carousel.js --- src/components/carousel/carousel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/carousel/carousel.js b/src/components/carousel/carousel.js index d216528a9df..981108ad87b 100644 --- a/src/components/carousel/carousel.js +++ b/src/components/carousel/carousel.js @@ -10,6 +10,7 @@ import { getActiveElement, reflow, removeClass, + requestAF, selectAll, setAttr } from '../../utils/dom' @@ -270,8 +271,8 @@ export const BCarousel = /*#__PURE__*/ Vue.extend({ if (this.isSliding) { // Schedule slide after sliding complete this.$once('sliding-end', () => { - // Wrap in setTimeout to allow the slide to properly finish to avoid glitching - setTimeout(() => this.setSlide(slide, direction)) + // Wrap in `requestAF()` to allow the slide to properly finish to avoid glitching + requestAF(() => this.setSlide(slide, direction)) }) return }