mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
Fixes #671. The method isOptionSelected on options of type 'object' was cycling but no returning after an existing option was found (true), resetting to false on next option.
This commit is contained in:
@@ -905,13 +905,16 @@
|
|||||||
*/
|
*/
|
||||||
isOptionSelected(option) {
|
isOptionSelected(option) {
|
||||||
let selected = false
|
let selected = false
|
||||||
this.valueAsArray.forEach(value => {
|
let i = 0
|
||||||
|
while (!selected && i < this.valueAsArray.length) {
|
||||||
|
let value = this.valueAsArray[i]
|
||||||
if (typeof value === 'object') {
|
if (typeof value === 'object') {
|
||||||
selected = this.optionObjectComparator(value, option)
|
selected = this.optionObjectComparator(value, option)
|
||||||
} else if (value === option || value === option[this.index]) {
|
} else if (value === option || value === option[i]) {
|
||||||
selected = true
|
selected = true
|
||||||
}
|
}
|
||||||
})
|
i++
|
||||||
|
}
|
||||||
return selected
|
return selected
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user