diff --git a/public/js/components/Calendar/Day/Page.js b/public/js/components/Calendar/Day/Page.js index 01cbd8ba9..44aadb837 100644 --- a/public/js/components/Calendar/Day/Page.js +++ b/public/js/components/Calendar/Day/Page.js @@ -53,6 +53,7 @@ export default { //TODO: workaround is to watch the active state and refetch in case the lvMenu is empty active: { handler(value) { + // handles fetching the lvMenu if (value) { if (!this.lvMenu) { this.fetchLvMenu(this.selectedEvent); @@ -64,7 +65,7 @@ export default { events: { handler(newEvents) { // if no event is selected, select the first event of the day - if (this.selectedEvent == null && newEvents[this.day.toDateString()].length > 0) { + if (this.selectedEvent == null && newEvents[this.day.toDateString()]?.length > 0) { let events = newEvents[this.day.toDateString()]; if (Array.isArray(events) && events.length > 0) { this.setSelectedEvent(events[0]); @@ -239,6 +240,9 @@ export default { } }, methods: { + dayScrollBehavior(event){ + this.$refs.dayScrollContainer?.scrollBy({ top: Math.sign(event.deltaY) * 100, behavior: 'instant' }); + }, dayGridStyle(day) { const styleObj = { 'grid-template-columns': '1 1fr', @@ -355,7 +359,7 @@ export default { template: /*html*/`