Skip to content

Commit 977a7e2

Browse files
committed
fix(VCalendar): prevent month view event duplication
fixes #22062
1 parent e41e091 commit 977a7e2

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

packages/vuetify/src/labs/VCalendar/composables/calendarWithEvents.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,8 @@ export function useCalendarWithEvents (props: CalendarWithEventsProps, slots: an
426426
{ ...base.getColorProps({ text, background }) }
427427
{ ...events }
428428
{ ...data }
429-
ref={ el => {
430-
if (el) eventsRef.value.push(el as HTMLElement)
431-
}}
429+
ref_for
430+
ref={ eventsRef }
432431
v-ripple={ props.eventRipple ?? true }
433432
>
434433
{ slot?.(scope) ?? genName(eventSummary) }
@@ -450,9 +449,8 @@ export function useCalendarWithEvents (props: CalendarWithEventsProps, slots: an
450449
<div
451450
style={{ height: `${height}px` }}
452451
data-date={ day.date }
453-
ref={ el => {
454-
if (el) eventsRef.value.push(el as HTMLElement)
455-
}}
452+
ref_for
453+
ref={ eventsRef }
456454
/>
457455
)
458456
}
@@ -472,9 +470,8 @@ export function useCalendarWithEvents (props: CalendarWithEventsProps, slots: an
472470
height: `${eventHeight}px`,
473471
marginBottom: `${eventMarginBottom}px`,
474472
}}
475-
ref={ el => {
476-
if (el) eventsRef.value.push(el as HTMLElement)
477-
}}
473+
ref_for
474+
ref={ eventsRef }
478475
v-ripple={ props.eventRipple ?? true }
479476
{ ...events }
480477
/>

0 commit comments

Comments
 (0)