Skip to content

Commit

Permalink
fix(VCombobox): don't reset search when cleared (#14531)
Browse files Browse the repository at this point in the history
fixes #14507
  • Loading branch information
ElijahKotyluk committed Dec 27, 2021
1 parent bab2fa2 commit 79cd41d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VCombobox/VCombobox.ts
Expand Up @@ -179,7 +179,7 @@ export default VAutocomplete.extend({
}
},
setValue (value?: any) {
VSelect.options.methods.setValue.call(this, value ?? this.internalSearch)
VSelect.options.methods.setValue.call(this, value === undefined ? this.internalSearch : value)
},
updateEditing () {
const value = this.internalValue.slice()
Expand Down
Expand Up @@ -298,15 +298,15 @@ describe('VCombobox.ts', () => {
expect(wrapper.vm.internalValue).toBe('')

wrapper.vm.setValue(null)
expect(wrapper.vm.internalValue).toBeUndefined()
expect(wrapper.vm.internalValue).toBeNull()

wrapper.vm.setValue(undefined)
expect(wrapper.vm.internalValue).toBeUndefined()

wrapper.setData({ lazySearch: 'foo' })

wrapper.vm.setValue(null)
expect(wrapper.vm.internalValue).toBe('foo')
expect(wrapper.vm.internalValue).toBeNull()

wrapper.vm.setValue(undefined)
expect(wrapper.vm.internalValue).toBe('foo')
Expand Down

0 comments on commit 79cd41d

Please sign in to comment.