Commit 252717e7c4c07ff3567a32fde408dd545677875f
Committed by
GitHub
Merge pull request #2193 from SergioCrisostomo/fix-2191
correct input value in filterable mode
Showing
2 changed files
with
22 additions
and
1 deletions
Show diff stats
src/components/select/option.vue
test/unit/specs/select.spec.js
... | ... | @@ -77,6 +77,27 @@ describe('Select.vue', () => { |
77 | 77 | }); |
78 | 78 | }); |
79 | 79 | |
80 | + it('should display normal characters in input when in filterable mode', done => { | |
81 | + vm = createVue({ | |
82 | + template: ` | |
83 | + <Select v-model="value" filterable> | |
84 | + <Option v-for="item in options" :value="item.value" :key="item.value">{{ item.label }}</Option> | |
85 | + </Select> | |
86 | + `, | |
87 | + data() { | |
88 | + return { | |
89 | + value: 2, | |
90 | + options: [{value: 1, label: '> 100$'}, {value: 2, label: '< 100$'}] | |
91 | + }; | |
92 | + } | |
93 | + }); | |
94 | + vm.$nextTick(() => { | |
95 | + const input = vm.$el.querySelector('.ivu-select-input'); | |
96 | + expect(input.value).to.equal('< 100$'); | |
97 | + done(); | |
98 | + }); | |
99 | + }); | |
100 | + | |
80 | 101 | it('should use the value\'s label instead of placeholder when both are set', done => { |
81 | 102 | vm = createVue({ |
82 | 103 | template: ` | ... | ... |