Fixed #5435 - Autocomplete: isSelected(option) doesn't work correctly when 'multiple' is true
parent
8c3ff4c5ec
commit
37a565535e
|
@ -771,8 +771,13 @@ export default {
|
|||
isValidSelectedOption(option) {
|
||||
return this.isValidOption(option) && this.isSelected(option);
|
||||
},
|
||||
isEquals(value1, value2) {
|
||||
return ObjectUtils.equals(value1, value2, this.equalityKey);
|
||||
},
|
||||
isSelected(option) {
|
||||
return ObjectUtils.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);
|
||||
const optionValue = this.getOptionValue(option);
|
||||
|
||||
return (this.modelValue || []).some((value) => this.isEquals(value, optionValue));
|
||||
},
|
||||
findFirstOptionIndex() {
|
||||
return this.visibleOptions.findIndex((option) => this.isValidOption(option));
|
||||
|
|
Loading…
Reference in New Issue