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,
// the 'dropdown list' should be stay hidden.
// [issue #5150]
if (this.autoComplete) {
let isInputFocused =
document.hasFocus &&
document.hasFocus() &&
document.activeElement === this.$el.querySelector('input');
this.visible = isInputFocused;
} else {
this.visible = true;
}
}
this.query = query;