mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-16 09:10:33 +03:00
Bug/629 show selected value (#631)
* Show current selection before searching * remove 'hidden' input class remove left border on input, adjust padding * Set 0 width for search input
This commit is contained in:
@@ -1591,55 +1591,6 @@ describe('Select.vue', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('should apply the "hidden" class to the search input when a value is present', () => {
|
||||
const vm = new Vue({
|
||||
template: '<div><v-select ref="select" :options="options" :value="value"></v-select></div>',
|
||||
data: {
|
||||
value: 'one',
|
||||
options: ['one', 'two', 'three']
|
||||
}
|
||||
}).$mount()
|
||||
|
||||
expect(vm.$children[0].inputClasses.hidden).toEqual(true)
|
||||
})
|
||||
|
||||
it('should not apply the "hidden" class to the search input when a value is present, and the dropdown is open', (done) => {
|
||||
const vm = new Vue({
|
||||
template: '<div><v-select ref="select" :options="options" :value="value"></v-select></div>',
|
||||
data: {
|
||||
value: 'one',
|
||||
options: ['one', 'two', 'three'],
|
||||
open: true
|
||||
}
|
||||
}).$mount()
|
||||
vm.$children[0].toggleDropdown({target: vm.$children[0].$refs.search})
|
||||
Vue.nextTick(() => {
|
||||
Vue.nextTick(() => {
|
||||
expect(vm.$children[0].open).toEqual(true)
|
||||
expect(vm.$children[0].inputClasses.hidden).toEqual(false)
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('should not apply the "hidden" class to the search input when a value is present, the dropdown is closed, and options are loading', (done) => {
|
||||
const vm = new Vue({
|
||||
template: '<div><v-select ref="select" :options="options" :value="value"></v-select></div>',
|
||||
data: {
|
||||
value: 'one',
|
||||
options: ['one', 'two', 'three'],
|
||||
open: true
|
||||
}
|
||||
}).$mount()
|
||||
vm.$refs.select.toggleLoading(true)
|
||||
Vue.nextTick(() => {
|
||||
Vue.nextTick(() => {
|
||||
expect(vm.$children[0].inputClasses.hidden).toEqual(false)
|
||||
done()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it ('should not reset the search input on focus lost when clearSearchOnSelect is false', (done) => {
|
||||
const vm = new Vue({
|
||||
template: '<div><v-select ref="select" :options="options" :value="value" :clear-search-on-select="false"></v-select></div>',
|
||||
|
||||
Reference in New Issue
Block a user