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

Commit e3e7b13

Browse files
authored
Merge pull request bootstrap-vue-next#1306 from bielfrontera/fix-carousel-item-class
fix(BCarousel): carousel-item class disappears after transition
2 parents f944ded + 4a6d6cc commit e3e7b13

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
:leave-to-class="leaveClasses"
2525
@before-leave="onBeforeLeave"
2626
@after-leave="onAfterLeave"
27+
@after-enter="onAfterEnter"
2728
>
2829
<component
2930
:is="slide"
@@ -275,6 +276,14 @@ const onAfterLeave = () => {
275276
emit('slid', buildBvCarouselEvent('slid'))
276277
isTransitioning.value = false
277278
}
279+
// carousel-item class is removed from the slide during the transition,
280+
// as is included within enter classes.
281+
// The first slide recovers carousel-item class,
282+
const onAfterEnter = (el: Element) => {
283+
if (modelValue.value !== 0) {
284+
el.classList.add('carousel-item')
285+
}
286+
}
278287
279288
onKeyStroke(
280289
'ArrowLeft',

0 commit comments

Comments
 (0)