Skip to content

Commit a33bc86

Browse files
committed
feat: adjust min and max sliding values in Carousel to improve boundary handling
1 parent b9ae2e5 commit a33bc86

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/Carousel/Carousel.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,11 +694,12 @@ export const Carousel = defineComponent({
694694
if (!config.wrapAround && config.preventExcessiveDragging) {
695695
const maxSlidingValue =
696696
(slidesCount.value - config.itemsToShow) * effectiveSlideSize.value
697-
697+
const min = isReversed.value ? 0 : -1 * maxSlidingValue
698+
const max = isReversed.value ? maxSlidingValue : 0
698699
totalOffset = getNumberInRange({
699700
val: totalOffset,
700-
min: -1 * maxSlidingValue,
701-
max: 0,
701+
min,
702+
max,
702703
})
703704
}
704705

0 commit comments

Comments
 (0)