Skip to content

Commit

Permalink
fix(VSlideGroup): always hide arrows when prop is false
Browse files Browse the repository at this point in the history
fixes #14586
  • Loading branch information
bokub committed Jan 10, 2022
1 parent 9e2edf3 commit 4053810
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/api-generator/src/locale/en/v-slide-group.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"mobileBreakpoint": "Sets the designated mobile breakpoint for the component.",
"nextIcon": "The appended slot when arrows are shown",
"prevIcon": "The prepended slot when arrows are shown",
"showArrows": "Change when the overflow arrow indicators are shown. By **default**, arrows *always* display on Desktop when the container is overflowing. When the container overflows on mobile, arrows are not shown by default. A **show-arrows** value of `true` allows these arrows to show on Mobile if the container overflowing. A value of `desktop` *always* displays arrows on Desktop while a value of `mobile` always displays arrows on Mobile. A value of `always` always displays arrows on Desktop *and* Mobile. Find more information on how to customize breakpoint thresholds on the [breakpoints page](/customizing/breakpoints)."
"showArrows": "Change when the overflow arrow indicators are shown. By **default**, arrows *always* display on Desktop when the container is overflowing. When the container overflows on mobile, arrows are not shown by default. A **show-arrows** value of `true` allows these arrows to show on Mobile if the container overflowing. A **show-arrows** value of `false` always hide the arrows. A value of `desktop` *always* displays arrows on Desktop while a value of `mobile` always displays arrows on Mobile. A value of `always` always displays arrows on Desktop *and* Mobile. Find more information on how to customize breakpoint thresholds on the [breakpoints page](/customizing/breakpoints)."
},
"slots": {
"next": "The next slot",
Expand Down
8 changes: 7 additions & 1 deletion packages/vuetify/src/components/VSlideGroup/VSlideGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import mixins, { ExtractVue } from '../../util/mixins'
// Types
import Vue, { VNode } from 'vue'
import { composedPath } from '../../util/helpers'
import { PropType } from 'vue/types/options'

interface TouchEvent {
touchstartX: number
Expand Down Expand Up @@ -126,8 +127,10 @@ export const BaseSlideGroup = mixins<options &
default: '$prev',
},
showArrows: {
type: [Boolean, String],
type: [Boolean, String] as PropType<boolean | string | undefined>,
default: undefined,
validator: v => (
v === undefined ||
typeof v === 'boolean' || [
'always',
'desktop',
Expand Down Expand Up @@ -187,6 +190,9 @@ export const BaseSlideGroup = mixins<options &
(this.isOverflowing || Math.abs(this.scrollOffset) > 0)
)

// Always hide arrows
case false: return false

// https://material.io/components/tabs#scrollable-tabs
// Always show arrows when
// overflowed on desktop
Expand Down

0 comments on commit 4053810

Please sign in to comment.