Skip to content

Commit 0633aef

Browse files
authored
fix(VSlideGroup): correct hasNext after resize (#21124)
fixes #21115
1 parent 965775f commit 0633aef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/vuetify/src/components/VSlideGroup/VSlideGroup.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ export const VSlideGroup = genericComponent<new <T>(
344344
isSelected: group.isSelected,
345345
}))
346346

347+
const hasOverflowOrScroll = computed(() => isOverflowing.value || Math.abs(scrollOffset.value) > 0)
348+
347349
const hasAffixes = computed(() => {
348350
switch (props.showArrows) {
349351
// Always show arrows on desktop & mobile
@@ -354,20 +356,20 @@ export const VSlideGroup = genericComponent<new <T>(
354356

355357
// Show arrows on mobile when overflowing.
356358
// This matches the default 2.2 behavior
357-
case true: return isOverflowing.value || Math.abs(scrollOffset.value) > 0
359+
case true: return hasOverflowOrScroll.value
358360

359361
// Always show on mobile
360362
case 'mobile': return (
361363
mobile.value ||
362-
(isOverflowing.value || Math.abs(scrollOffset.value) > 0)
364+
hasOverflowOrScroll.value
363365
)
364366

365367
// https://material.io/components/tabs#scrollable-tabs
366368
// Always show arrows when
367369
// overflowed on desktop
368370
default: return (
369371
!mobile.value &&
370-
(isOverflowing.value || Math.abs(scrollOffset.value) > 0)
372+
hasOverflowOrScroll.value
371373
)
372374
}
373375
})
@@ -378,7 +380,7 @@ export const VSlideGroup = genericComponent<new <T>(
378380
})
379381

380382
const hasNext = computed(() => {
381-
if (!containerRef.value) return false
383+
if (!containerRef.value || !hasOverflowOrScroll.value) return false
382384

383385
const scrollSize = getScrollSize(isHorizontal.value, containerRef.el)
384386
const clientSize = getClientSize(isHorizontal.value, containerRef.el)

0 commit comments

Comments
 (0)