Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cascader: 多选和过滤情况下,修复关键字没有清空的bug #22913

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/cascader/src/cascader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
</el-tag>
<input
v-if="filterable && !isDisabled"
ref="inputSearch"
v-model.trim="inputValue"
type="text"
class="el-cascader__search-input"
Expand Down Expand Up @@ -314,6 +315,14 @@ export default {
const { value, dropDownVisible } = this;
const { checkStrictly, multiple } = this.config;

if (this.filterable) {
this.inputValue = '';
this.getSuggestions();
if (this.multiple) {
this.$refs.inputSearch.focus();
}
}

if (!isEqual(val, value) || isUndefined(value)) {
this.computePresentContent();
// hide dropdown when single mode
Expand Down