mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +03:00
fix: allow selecting boolean values (#1518)
This commit is contained in:
@@ -702,7 +702,7 @@ export default {
|
||||
value = this.$data._value
|
||||
}
|
||||
|
||||
if (value) {
|
||||
if (value !== undefined && value !== null) {
|
||||
return [].concat(value)
|
||||
}
|
||||
|
||||
|
||||
@@ -213,6 +213,23 @@ describe('VS - Selecting Values', () => {
|
||||
expect(Select.vm.selectedValue).toEqual(options)
|
||||
})
|
||||
|
||||
fit('can select a false boolean option', async () => {
|
||||
const Select = mountDefault({
|
||||
options: [false],
|
||||
})
|
||||
|
||||
expect(Select.vm.isOptionSelected(false)).toBeFalsy()
|
||||
expect(Select.vm.optionExists(false)).toBeTruthy()
|
||||
|
||||
Select.vm.open = true
|
||||
await Select.vm.$nextTick()
|
||||
|
||||
Select.find('.vs__dropdown-option').trigger('click')
|
||||
await Select.vm.$nextTick()
|
||||
|
||||
expect(Select.vm.selectedValue).toEqual([false])
|
||||
})
|
||||
|
||||
describe('input Event', () => {
|
||||
it('will trigger the input event when the selection changes', () => {
|
||||
const Select = shallowMount(VueSelect)
|
||||
|
||||
Reference in New Issue
Block a user