2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-19 09:50:33 +03:00

Add option to allow closing a multi-select when a value is selected

This commit is contained in:
Kori Roys
2017-03-31 15:10:24 +02:00
parent 90981a5a7f
commit 897b0d8fb2
3 changed files with 37 additions and 1 deletions
+20
View File
@@ -351,6 +351,26 @@ describe('Select.vue', () => {
})
})
it('can close the dropdown when the el is clicked, multiple is true, and multipleCloseOnSelect option is true', (done) => {
const vm = new Vue({
template: '<div><v-select ref="select" :options="options" multiple closeOnMultiSelect :value="value"></v-select></div>',
components: {vSelect},
data: {
value: [],
options: ['one', 'two', 'three']
}
}).$mount()
vm.$children[0].open = true
vm.$refs.select.select('one')
Vue.nextTick(() => {
expect(vm.$children[0].open).toEqual(false)
done()
})
})
it('should close the dropdown on search blur', () => {
const vm = new Vue({
template: '<div><v-select :options="options" multiple :value="value"></v-select></div>',