Open sintesiNick opened 8 months ago
public setScrollPosition(): void { if (this.$el) { console.log(this.$el.querySelector('.vuecalbg')); const bandStartTimes = this.events.map(band => new Date(band.start).getHours() * 60 + new Date(band.start).getMinutes()); this.$el.querySelector('.vuecalbg').scrollTop = ((Math.min(...bandStartTimes) - 60) / 60) * 40; } }
Using this code I'm setting the scrollTop of the calendar.
I'm using the querySelector for .vuecal__bg.
The weird part is that it only works with multiple events, not with 1 event, but when i go inside the code it is there.
Anyone knows what could be causing this?
Multiple events:
Single event:
public setScrollPosition(): void { if (this.$el) { console.log(this.$el.querySelector('.vuecalbg')); const bandStartTimes = this.events.map(band => new Date(band.start).getHours() * 60 + new Date(band.start).getMinutes()); this.$el.querySelector('.vuecalbg').scrollTop = ((Math.min(...bandStartTimes) - 60) / 60) * 40; } }
Using this code I'm setting the scrollTop of the calendar.
I'm using the querySelector for .vuecal__bg.
The weird part is that it only works with multiple events, not with 1 event, but when i go inside the code it is there.![image](https://github.com/antoniandre/vue-cal/assets/150345515/e8f95a81-8382-4128-a549-72ae3ba591fb)
Anyone knows what could be causing this?
Multiple events:![image](https://github.com/antoniandre/vue-cal/assets/150345515/d1fe1230-753f-46d0-9b3e-2887bc4edc21)
Single event:
![image](https://github.com/antoniandre/vue-cal/assets/150345515/6ce53a9f-05ea-42a3-a191-b20bd85ca7b4)