Merge pull request #2193 from SergioCrisostomo/fix-2191
correct input value in filterable mode
This commit is contained in:
commit
252717e7c4
2 changed files with 22 additions and 1 deletions
|
@ -66,7 +66,7 @@
|
|||
},
|
||||
// 在使用函数防抖后,设置 key 后,不更新组件了,导致SearchLabel 不更新 #1865
|
||||
updateSearchLabel () {
|
||||
this.searchLabel = this.$el.innerHTML;
|
||||
this.searchLabel = this.$el.textContent;
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
|
|
@ -77,6 +77,27 @@ describe('Select.vue', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should display normal characters in input when in filterable mode', done => {
|
||||
vm = createVue({
|
||||
template: `
|
||||
<Select v-model="value" filterable>
|
||||
<Option v-for="item in options" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
||||
</Select>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
value: 2,
|
||||
options: [{value: 1, label: '> 100$'}, {value: 2, label: '< 100$'}]
|
||||
};
|
||||
}
|
||||
});
|
||||
vm.$nextTick(() => {
|
||||
const input = vm.$el.querySelector('.ivu-select-input');
|
||||
expect(input.value).to.equal('< 100$');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should use the value\'s label instead of placeholder when both are set', done => {
|
||||
vm = createVue({
|
||||
template: `
|
||||
|
|
Loading…
Add table
Reference in a new issue