Skip to content

Commit

Permalink
fix search for object in BIMDataSelectMulti component
Browse files Browse the repository at this point in the history
  • Loading branch information
LrxGaelle committed Oct 11, 2023
1 parent b5083a0 commit 557d189
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/BIMDataComponents/BIMDataSelect/BIMDataSelectMulti.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,26 @@ export default {
return this.options;
} else {
const lowerCaseSearchText = this.searchText.toLowerCase();
return this.options.filter(option =>
option.toLowerCase().includes(lowerCaseSearchText),
);
if (this.optionLabelKey) {
return this.options.filter(option =>
option[this.optionLabelKey]
.toLowerCase()
.includes(lowerCaseSearchText),
);
}
if (this.optionKey) {
return this.options.filter(
option =>
option.optionGroup ||
option[this.optionKey]
.toLowerCase()
.includes(lowerCaseSearchText),
);
} else {
return this.options.filter(option =>
option.toLowerCase().includes(lowerCaseSearchText),
);
}
}
},
},
Expand Down

0 comments on commit 557d189

Please sign in to comment.