Skip to content

Conversation

@emmettxt
Copy link
Contributor

Description

Fixes #22251
Also removes duplicate exposed scrollArea and scrollAreaRef in VCalendar Api.

Markup:

<template>
  <v-row>
    <v-col>
      <v-sheet height="400" border>
        <v-calendar
          ref="calendar"
          :events="events"
          :model-value="today"
          :now="today"
          color="primary"
          type="week"
        />
        <v-btn @click="calendar.scrollToTime('08:00')">scroll to 8am</v-btn>
      </v-sheet>
    </v-col>
  </v-row>
</template>

<script setup lang="ts">
  import { onMounted, ref } from 'vue'

  const calendar = ref()

  const today = ref('2019-01-08')
  const events = [
    {
      name: 'Weekly Meeting',
      start: '2019-01-07 09:00',
      end: '2019-01-07 10:00',
    },
    {
      name: `Thomas' Birthday`,
      start: '2019-01-10',
    },
    {
      name: 'Mash Potatoes',
      start: '2019-01-09 12:30',
      end: '2019-01-09 15:30',
    },
  ]

  onMounted(() => {
    calendar.value.scrollToTime('08:00')
  })
</script>

@KaelWD KaelWD merged commit 16dc1d2 into vuetifyjs:master Oct 29, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report][3.10.7] VCalendar scrollToTime not working

2 participants