Skip to content

Commit ca0561a

Browse files
committed
Update carousel.js
1 parent 76500af commit ca0561a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/carousel/carousel.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
getActiveElement,
1111
reflow,
1212
removeClass,
13+
requestAF,
1314
selectAll,
1415
setAttr
1516
} from '../../utils/dom'
@@ -270,8 +271,8 @@ export const BCarousel = /*#__PURE__*/ Vue.extend({
270271
if (this.isSliding) {
271272
// Schedule slide after sliding complete
272273
this.$once('sliding-end', () => {
273-
// Wrap in setTimeout to allow the slide to properly finish to avoid glitching
274-
setTimeout(() => this.setSlide(slide, direction))
274+
// Wrap in `requestAF()` to allow the slide to properly finish to avoid glitching
275+
requestAF(() => this.setSlide(slide, direction))
275276
})
276277
return
277278
}

0 commit comments

Comments
 (0)