Fix other values getting pushed away when creating a new one through multiselect
This commit is contained in:
parent
028dbf27ee
commit
cf25e96c50
1 changed files with 4 additions and 1 deletions
|
@ -222,7 +222,7 @@ export default {
|
|||
})
|
||||
},
|
||||
filteredSearchResults() {
|
||||
if (this.multiple && this.internalValue !== null) {
|
||||
if (this.multiple && this.internalValue !== null && Array.isArray(this.internalValue)) {
|
||||
return this.searchResults.filter(item => !this.internalValue.some(e => e === item))
|
||||
}
|
||||
|
||||
|
@ -282,6 +282,9 @@ export default {
|
|||
this.closeSearchResults()
|
||||
},
|
||||
setSelectedObject(object, resetOnly = false) {
|
||||
if (!Array.isArray(object)) {
|
||||
object = [object]
|
||||
}
|
||||
this.$set(this, 'internalValue', object)
|
||||
|
||||
// We assume we're getting an array when multiple is enabled and can therefore leave the query
|
||||
|
|
Loading…
Reference in a new issue