Merge pull request #757 from dellenshang/master
fix #728 当Select 有 OptionGroup时 开启 filterable, 再次打开只显示了当前选中的这项的bug
This commit is contained in:
commit
caf1918915
1 changed files with 5 additions and 1 deletions
|
@ -334,6 +334,7 @@
|
||||||
lastRemoteQuery: '',
|
lastRemoteQuery: '',
|
||||||
unchangedQuery: true,
|
unchangedQuery: true,
|
||||||
hasExpectedValue: false,
|
hasExpectedValue: false,
|
||||||
|
isTyping: false, // #728
|
||||||
preventRemoteCall: false,
|
preventRemoteCall: false,
|
||||||
filterQueryChange: false, // #4273
|
filterQueryChange: false, // #4273
|
||||||
};
|
};
|
||||||
|
@ -451,7 +452,7 @@
|
||||||
let children = cOptions.children;
|
let children = cOptions.children;
|
||||||
|
|
||||||
// remove filtered children
|
// remove filtered children
|
||||||
if (this.filterable){
|
if (this.filterable && this.isTyping){ // #728 let option show full when reclick it
|
||||||
children = children.filter(
|
children = children.filter(
|
||||||
({componentOptions}) => this.validateOption(componentOptions)
|
({componentOptions}) => this.validateOption(componentOptions)
|
||||||
);
|
);
|
||||||
|
@ -580,6 +581,8 @@
|
||||||
},
|
},
|
||||||
hideMenu () {
|
hideMenu () {
|
||||||
this.toggleMenu(null, false);
|
this.toggleMenu(null, false);
|
||||||
|
// fix #728
|
||||||
|
this.isTyping = false;
|
||||||
setTimeout(() => this.unchangedQuery = true, ANIMATION_TIMEOUT);
|
setTimeout(() => this.unchangedQuery = true, ANIMATION_TIMEOUT);
|
||||||
},
|
},
|
||||||
onClickOutside(event){
|
onClickOutside(event){
|
||||||
|
@ -735,6 +738,7 @@
|
||||||
}, ANIMATION_TIMEOUT);
|
}, ANIMATION_TIMEOUT);
|
||||||
},
|
},
|
||||||
onQueryChange(query) {
|
onQueryChange(query) {
|
||||||
|
this.isTyping = true;
|
||||||
if (query.length > 0 && query !== this.query) {
|
if (query.length > 0 && query !== this.query) {
|
||||||
// in 'AutoComplete', when set an initial value asynchronously,
|
// in 'AutoComplete', when set an initial value asynchronously,
|
||||||
// the 'dropdown list' should be stay hidden.
|
// the 'dropdown list' should be stay hidden.
|
||||||
|
|
Loading…
Add table
Reference in a new issue