fix #4273
This commit is contained in:
parent
7a2155098f
commit
47f03c5419
2 changed files with 15 additions and 2 deletions
|
@ -155,6 +155,7 @@
|
|||
},
|
||||
resetInputState () {
|
||||
this.inputLength = this.$refs.input.value.length * 12 + 20;
|
||||
this.$emit('on-keydown');
|
||||
},
|
||||
handleInputDelete () {
|
||||
if (this.multiple && this.selectedMultiple.length && this.query === '') {
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
@on-input-focus="isFocused = true"
|
||||
@on-input-blur="isFocused = false"
|
||||
@on-clear="clearSingleSelect"
|
||||
|
||||
@on-keydown="handleFilterInputKeyDown"
|
||||
/>
|
||||
</slot>
|
||||
</div>
|
||||
|
@ -264,6 +266,7 @@
|
|||
unchangedQuery: true,
|
||||
hasExpectedValue: false,
|
||||
preventRemoteCall: false,
|
||||
filterQueryKeyDown: false, // #4273
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -392,7 +395,7 @@
|
|||
if (cOptions.children.length > 0) selectOptions.push({...option});
|
||||
} else {
|
||||
// ignore option if not passing filter
|
||||
if (!hasDefaultSelected) {
|
||||
if (!hasDefaultSelected || this.filterQueryKeyDown) {
|
||||
const optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option;
|
||||
if (!optionPassesFilter) continue;
|
||||
}
|
||||
|
@ -402,6 +405,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
this.filterQueryKeyDown = false;
|
||||
|
||||
return selectOptions;
|
||||
},
|
||||
flatOptions(){
|
||||
|
@ -658,7 +663,14 @@
|
|||
if (this.getInitialValue().length > 0 && this.selectOptions.length === 0) {
|
||||
this.hasExpectedValue = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 下面的方法,当 filterable 时,输入内容时,标记,用于区分和直接选择而引起的 bug
|
||||
* #4273
|
||||
* */
|
||||
handleFilterInputKeyDown () {
|
||||
this.filterQueryKeyDown = true;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
value(value){
|
||||
|
|
Loading…
Add table
Reference in a new issue