mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Fixed #5435 - Autocomplete: isSelected(option) doesn't work correctly when 'multiple' is true
This commit is contained in:
parent
8c3ff4c5ec
commit
37a565535e
1 changed files with 6 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue