Update select.vue

This commit is contained in:
Aresn 2019-01-07 14:28:43 +08:00 committed by GitHub
parent 33c826ec16
commit 5f25fecafb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -639,12 +639,15 @@
// 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.
// [issue #5150] // [issue #5150]
let isInputFocused = if (this.autoComplete) {
document.hasFocus && let isInputFocused =
document.hasFocus() && document.hasFocus &&
document.activeElement === this.$el.querySelector('input'); document.hasFocus() &&
document.activeElement === this.$el.querySelector('input');
this.visible = isInputFocused; this.visible = isInputFocused;
} else {
this.visible = true;
}
} }
this.query = query; this.query = query;