Skip to content

Commit

Permalink
fix(Calendar): multiple is not working (#1392)
Browse files Browse the repository at this point in the history
Co-authored-by: beatrizHer <beatrizHer@users.noreply.github.com>
  • Loading branch information
zernonia and beatrizHer authored Oct 26, 2024
1 parent 78e9794 commit e49081f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/radix-vue/src/Calendar/CalendarRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,10 @@ function onDateChange(value: DateValue) {
}
else { modelValue.value = value.copy() }
}
else if (!modelValue.value) {
modelValue.value = [value.copy()]
}
else if (Array.isArray(modelValue.value)) {
if (!modelValue.value) {
modelValue.value = [value.copy()]
return
}
const index = modelValue.value.findIndex(date => isSameDay(date, value))
if (index === -1) {
modelValue.value = [...modelValue.value, value]
Expand Down

0 comments on commit e49081f

Please # to comment.