Skip to content

Commit

Permalink
fix: multiple selection in NeCombobox
Browse files Browse the repository at this point in the history
  • Loading branch information
andre8244 committed Apr 11, 2024
1 parent ae71401 commit 9bb1da6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/NeCombobox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,13 @@ function selectMultipleOptionsFromModelValue() {
const selectedList: NeComboboxOption[] = []

for (const selectedOption of props.modelValue as NeComboboxOption[]) {
const optionFound = props.options.find((option) => option.id === selectedOption.id)
const optionFound = allOptions.value.find((option) => option.id === selectedOption.id)

if (optionFound) {
selectedList.push(optionFound)
} else if (props.acceptUserInput) {
userInputOptions.value.push(selectedOption)
selectedList.push(selectedOption)
}
}

Expand All @@ -288,7 +291,7 @@ function removeFromSelection(optionToRemove: NeComboboxOption) {
)
}

// detect clic outside to close the options list
// detect click outside to close the options list
onClickOutside(comboboxRef, () => onClickOutsideCombobox())
</script>

Expand Down

0 comments on commit 9bb1da6

Please sign in to comment.