Open sintesiNick opened 1 year 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.
Anyone knows what could be causing this?
Multiple events:
Single event: