Skip to content

Commit 3b4b5e6

Browse files
committed
fix(VCalendar): wrap unclamped timeToY
fixes #22413
1 parent 4f7cc6a commit 3b4b5e6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/vuetify/src/components/VCalendar/composables/calendarWithIntervals.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export function useCalendarWithIntervals (props: CalendarWithIntervalsProps) {
211211

212212
function timeToY (
213213
time: VTime | CalendarTimestamp,
214-
targetDateOrClamp: CalendarTimestamp | boolean = true
214+
targetDateOrClamp: CalendarTimestamp | boolean = false
215215
): number | false {
216216
const clamp = targetDateOrClamp !== false
217217
const targetDate = typeof targetDateOrClamp !== 'boolean' ? targetDateOrClamp : undefined
@@ -224,10 +224,15 @@ export function useCalendarWithIntervals (props: CalendarWithIntervalsProps) {
224224
if (clamp) {
225225
if (y < 0) {
226226
y = 0
227-
}
228-
if (y > bodyHeight.value) {
227+
} else if (y > bodyHeight.value) {
229228
y = bodyHeight.value
230229
}
230+
} else {
231+
if (y < 0) {
232+
y = y + bodyHeight.value
233+
} else if (y > bodyHeight.value) {
234+
y = y - bodyHeight.value
235+
}
231236
}
232237

233238
return y

0 commit comments

Comments
 (0)