Merge branch 'master' into v4

This commit is contained in:
Cagatay Civici 2024-03-25 11:06:16 +03:00
commit 5a6e010794
12 changed files with 34 additions and 19 deletions

View file

@ -777,8 +777,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.multiple ? (this.modelValue || []).some((value) => this.isEquals(value, optionValue)) : this.isEquals(this.modelValue, this.getOptionValue(option));
},
findFirstOptionIndex() {
return this.visibleOptions.findIndex((option) => this.isValidOption(option));