Skip to content

Commit

Permalink
fix(VTabs): allow set VTab inactive if optional property is set (#14399)
Browse files Browse the repository at this point in the history
resolves #14397
  • Loading branch information
JJetmar committed Nov 21, 2021
1 parent ef8b3cc commit 958d4e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/vuetify/src/components/VTabs/VTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import { ExtractVue } from './../../util/mixins'
// Types
import { VNode } from 'vue/types'

// Components
import VTabsBar from '../VTabs/VTabsBar'

const baseMixins = mixins(
Routable,
// Must be after routable
Expand All @@ -19,8 +22,11 @@ const baseMixins = mixins(
Themeable
)

type VTabBarInstance = InstanceType<typeof VTabsBar>

interface options extends ExtractVue<typeof baseMixins> {
$el: HTMLElement
tabsBar: VTabBarInstance
}

export default baseMixins.extend<options>().extend(
Expand Down Expand Up @@ -92,7 +98,7 @@ export default baseMixins.extend<options>().extend(
},
toggle () {
// VItemGroup treats a change event as a click
if (!this.isActive) {
if (!this.isActive || (!this.tabsBar.mandatory && !this.to)) {
this.$emit('change')
}
},
Expand Down

0 comments on commit 958d4e6

Please sign in to comment.