Skip to content

Commit 6f08e94

Browse files
authored
Select: not clear text when filtering (#12304)
1 parent 4af2d87 commit 6f08e94

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/select/src/option.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,14 @@
8686
currentLabel() {
8787
if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
8888
},
89-
value() {
90-
if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
89+
value(val, oldVal) {
90+
const { remote, valueKey } = this.select;
91+
if (!this.created && !remote) {
92+
if (valueKey && typeof val === 'object' && typeof oldVal === 'object' && val[valueKey] === oldVal[valueKey]) {
93+
return;
94+
}
95+
this.dispatch('ElSelect', 'setSelected');
96+
}
9197
}
9298
},
9399

0 commit comments

Comments
 (0)