This commit is contained in:
Rookie_Zoe 2019-01-07 12:24:48 +08:00
parent de3614371e
commit 33c826ec16
2 changed files with 49 additions and 37 deletions

View file

@ -635,7 +635,18 @@
}, ANIMATION_TIMEOUT);
},
onQueryChange(query) {
if (query.length > 0 && query !== this.query) this.visible = true;
if (query.length > 0 && query !== this.query) {
// in 'AutoComplete', when set an initial value asynchronously,
// the 'dropdown list' should be stay hidden.
// [issue #5150]
let isInputFocused =
document.hasFocus &&
document.hasFocus() &&
document.activeElement === this.$el.querySelector('input');
this.visible = isInputFocused;
}
this.query = query;
this.unchangedQuery = this.visible;
this.filterQueryChange = true;