Skip to content

Commit

Permalink
Update TagsInputRoot.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
ploca14 authored Dec 19, 2024
1 parent 77f92dd commit fd5ad7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/radix-vue/src/TagsInput/TagsInputRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ provideTagsInputRootContext({
},
onRemoveValue: (index) => {
if (index !== -1)
modelValue.value = modelValue.value.toSpliced(index, 1)
modelValue.value = [...modelValue.value].splice(index, 1)
},
onInputKeydown: (event) => {
const target = event.target as HTMLInputElement
Expand All @@ -158,7 +158,7 @@ provideTagsInputRootContext({
if (selectedElement.value) {
const index = collection.findIndex(i => i === selectedElement.value)
modelValue.value = modelValue.value.toSpliced(index, 1)
modelValue.value = [...modelValue.value].splice(index, 1)
selectedElement.value = selectedElement.value === lastTag ? collection.at(index - 1) : collection.at(index + 1)
event.preventDefault()
}
Expand Down

0 comments on commit fd5ad7d

Please sign in to comment.