Fix other values getting pushed away when creating a new one through multiselect
continuous-integration/drone/push Build was killed Details

This commit is contained in:
kolaente 2021-07-22 21:57:33 +02:00
parent 028dbf27ee
commit cf25e96c50
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 1 deletions

View File

@ -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