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:
@@ -904,15 +904,18 @@
|
|||||||
* @return {Boolean} True when selected | False otherwise
|
* @return {Boolean} True when selected | False otherwise
|
||||||
*/
|
*/
|
||||||
isOptionSelected(option) {
|
isOptionSelected(option) {
|
||||||
let selected = false
|
let selected = false
|
||||||
this.valueAsArray.forEach(value => {
|
let i = 0
|
||||||
if (typeof value === 'object') {
|
while (!selected && i < this.valueAsArray.length) {
|
||||||
selected = this.optionObjectComparator(value, option)
|
let value = this.valueAsArray[i]
|
||||||
} else if (value === option || value === option[this.index]) {
|
if (typeof value === 'object') {
|
||||||
selected = true
|
selected = this.optionObjectComparator(value, option)
|
||||||
}
|
} else if (value === option || value === option[i]) {
|
||||||
})
|
selected = true
|
||||||
return selected
|
}
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
return selected
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user