Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 4a6d6cc

Browse files
author
Biel Frontera
committed
fix(BCarousel): carousel-item class disappears after transition
1 parent 87242e4 commit 4a6d6cc

File tree

1 file changed

+9
-0
lines changed
  • packages/bootstrap-vue-next/src/components/BCarousel

1 file changed

+9
-0
lines changed

packages/bootstrap-vue-next/src/components/BCarousel/BCarousel.vue

+9
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
:leave-to-class="leaveClasses"
3333
@before-leave="onBeforeLeave"
3434
@after-leave="onAfterLeave"
35+
@after-enter="onAfterEnter"
3536
>
3637
<component
3738
:is="slide"
@@ -281,6 +282,14 @@ const onAfterLeave = () => {
281282
emit('slid', buildBvCarouselEvent('slid'))
282283
isTransitioning.value = false
283284
}
285+
// carousel-item class is removed from the slide during the transition,
286+
// as is included within enter classes.
287+
// The first slide recovers carousel-item class,
288+
const onAfterEnter = (el: Element) => {
289+
if (modelValue.value !== 0) {
290+
el.classList.add('carousel-item')
291+
}
292+
}
284293
285294
watch(
286295
() => props.ride,

0 commit comments

Comments
 (0)