Skip to content

Commit

Permalink
fix(vue): DataSearch issue with multi keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
bietkul committed Oct 10, 2022
1 parent 35cdb79 commit 8dd3753
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/vue/src/components/search/DataSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@ const DataSearch = {
this.setValue(newVal, true, this.$props);
},
value(newVal, oldVal) {
if (!isEqual(newVal, oldVal)) {
if (
!isEqual(newVal, oldVal)
|| (this.$options.isTagsMode && !isEqual(newVal, this.selectedTags))
) {
if (this.isPending && this.$options.isTagsMode && Array.isArray(newVal)) {
this.isPending = false;
}
Expand Down Expand Up @@ -531,10 +534,7 @@ const DataSearch = {
if (typeof value === 'string' && !!value) {
this.selectedTags.push(value);
} else if (Array.isArray(value) && !isEqual(this.selectedTags, value)) {
const mergedArray = Array.from(
new Set([...this.selectedTags, ...value]),
);
this.selectedTags = mergedArray;
this.selectedTags = value;
}
} else if (value) {
this.selectedTags = typeof value !== 'string' ? value : [...value];
Expand Down Expand Up @@ -918,7 +918,6 @@ const DataSearch = {
const shouldRenderClearAllTag = tagsList.length > 1;
const renderSelectedTags
= this.$scopedSlots.renderSelectedTags || this.$props.renderSelectedTags;

return renderSelectedTags ? (
renderSelectedTags({
values: this.selectedTags,
Expand Down

0 comments on commit 8dd3753

Please sign in to comment.