diff --git a/examples/routers/auto-complete.vue b/examples/routers/auto-complete.vue
index 0ecd673f..6d3cb96a 100644
--- a/examples/routers/auto-complete.vue
+++ b/examples/routers/auto-complete.vue
@@ -1,40 +1,41 @@
-
+
\ No newline at end of file
+ },
+ methods: {},
+ created() {
+ setTimeout(() => {
+ this.value = "1.0.0.5";
+ this.data = [
+ "12412515",
+ "123444",
+ "12355",
+ "12345",
+ "12312",
+ "1234",
+ "123",
+ "111",
+ "5.2.3.4",
+ "1.2.3.4",
+ "1.2.3.4.5",
+ "1.2.3.4.5.6",
+ "1.2.3.4.5.6.7",
+ "1.0.0.8",
+ "1.0.0.5",
+ "whb-03"
+ ];
+ // this.disabled = true;
+ }, 1000);
+ }
+};
+
diff --git a/src/components/select/select.vue b/src/components/select/select.vue
index d446a8ad..8a7752a6 100644
--- a/src/components/select/select.vue
+++ b/src/components/select/select.vue
@@ -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;