Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting scroll top, only finds querySelector with multiple events. #565

Open
sintesiNick opened this issue Nov 24, 2023 · 0 comments
Open

Comments

@sintesiNick
Copy link

sintesiNick commented Nov 24, 2023

public setScrollPosition(): void {
if (this.$el) {
console.log(this.$el.querySelector('.vuecal__bg'));
const bandStartTimes = this.events.map(band => new Date(band.start).getHours() * 60 + new Date(band.start).getMinutes());
this.$el.querySelector('.vuecal__bg').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

Anyone knows what could be causing this?

Multiple events:
image

Single event:
image
image

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

No branches or pull requests

1 participant