Commit 5f25fecafbdc5044be16f13360923050925787a2
Committed by
GitHub

1 parent
33c826ec
Update select.vue
Showing
1 changed file
with
9 additions
and
6 deletions
Show diff stats
src/components/select/select.vue
@@ -639,12 +639,15 @@ | @@ -639,12 +639,15 @@ | ||
639 | // in 'AutoComplete', when set an initial value asynchronously, | 639 | // in 'AutoComplete', when set an initial value asynchronously, |
640 | // the 'dropdown list' should be stay hidden. | 640 | // the 'dropdown list' should be stay hidden. |
641 | // [issue #5150] | 641 | // [issue #5150] |
642 | - let isInputFocused = | ||
643 | - document.hasFocus && | ||
644 | - document.hasFocus() && | ||
645 | - document.activeElement === this.$el.querySelector('input'); | ||
646 | - | ||
647 | - this.visible = isInputFocused; | 642 | + if (this.autoComplete) { |
643 | + let isInputFocused = | ||
644 | + document.hasFocus && | ||
645 | + document.hasFocus() && | ||
646 | + document.activeElement === this.$el.querySelector('input'); | ||
647 | + this.visible = isInputFocused; | ||
648 | + } else { | ||
649 | + this.visible = true; | ||
650 | + } | ||
648 | } | 651 | } |
649 | 652 | ||
650 | this.query = query; | 653 | this.query = query; |