From cf25e96c509675b8a1e2113505468ee39d7e8fc2 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 22 Jul 2021 21:57:33 +0200 Subject: [PATCH] Fix other values getting pushed away when creating a new one through multiselect --- src/components/input/multiselect.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/input/multiselect.vue b/src/components/input/multiselect.vue index c25de19fbc..a6857c0540 100644 --- a/src/components/input/multiselect.vue +++ b/src/components/input/multiselect.vue @@ -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