Fixed #2901 - MultiSelect: filtering causes labels of currently selected values to display "null"

pull/2910/head
mertsincan 2022-08-30 12:56:22 +01:00
parent c391fa4268
commit d77c9a48c8
1 changed files with 2 additions and 1 deletions

View File

@ -746,7 +746,8 @@ export default {
return !(this.$el.isSameNode(event.target) || this.$el.contains(event.target) || (this.overlay && this.overlay.contains(event.target))); return !(this.$el.isSameNode(event.target) || this.$el.contains(event.target) || (this.overlay && this.overlay.contains(event.target)));
}, },
getLabelByValue(value) { getLabelByValue(value) {
const matchedOption = this.visibleOptions.find(option => !this.isOptionGroup(option) && ObjectUtils.equals(this.getOptionValue(option), value, this.equalityKey)); const options = this.optionGroupLabel ? this.flatOptions(this.options) : (this.options || []);
const matchedOption = options.find(option => !this.isOptionGroup(option) && ObjectUtils.equals(this.getOptionValue(option), value, this.equalityKey));
return matchedOption ? this.getOptionLabel(matchedOption): null; return matchedOption ? this.getOptionLabel(matchedOption): null;
}, },
getSelectedItemsLabel() { getSelectedItemsLabel() {