Skip to content

Commit

Permalink
fix(VItemGroup): allow null values (#14436)
Browse files Browse the repository at this point in the history
fixes #9073
  • Loading branch information
KaelWD authored Nov 30, 2021
1 parent 2af9a41 commit a0dd90d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VItemGroup/VItemGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const BaseItemGroup = mixins(
}
},
getValue (item: GroupableInstance, i: number): unknown {
return item.value == null || item.value === ''
return item.value === undefined
? i
: item.value
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ describe('VItemGroup', () => {

const getValue = wrapper.vm.getValue

expect(getValue({ value: null }, 0)).toBe(0)
expect(getValue({ value: null }, 0)).toBeNull()
expect(getValue({ value: undefined }, 1)).toBe(1)
expect(getValue({ value: '' }, 2)).toBe(2)
expect(getValue({ value: '' }, 2)).toBe('')
expect(getValue({ value: 'foo' }, 'foo')).toBe('foo')
})

Expand Down
4 changes: 3 additions & 1 deletion packages/vuetify/src/components/VTabs/VTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export default baseMixins.extend<options>().extend(
}
},
value (): any {
let to = this.to || this.href || ''
let to = this.to || this.href

if (to == null) return to

if (this.$router &&
this.to === Object(this.to)
Expand Down

0 comments on commit a0dd90d

Please sign in to comment.