From d77c9a48c804ae89612fc49ea08899f473b3863b Mon Sep 17 00:00:00 2001 From: mertsincan Date: Tue, 30 Aug 2022 12:56:22 +0100 Subject: [PATCH] Fixed #2901 - MultiSelect: filtering causes labels of currently selected values to display "null" --- src/components/multiselect/MultiSelect.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/multiselect/MultiSelect.vue b/src/components/multiselect/MultiSelect.vue index 97e6feeef..d2c0b7245 100755 --- a/src/components/multiselect/MultiSelect.vue +++ b/src/components/multiselect/MultiSelect.vue @@ -746,7 +746,8 @@ export default { return !(this.$el.isSameNode(event.target) || this.$el.contains(event.target) || (this.overlay && this.overlay.contains(event.target))); }, 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; }, getSelectedItemsLabel() {