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

scrollLeft within calendar does not scroll left in weekView #685

Open
valentinbld45 opened this issue Feb 5, 2025 · 0 comments
Open

scrollLeft within calendar does not scroll left in weekView #685

valentinbld45 opened this issue Feb 5, 2025 · 0 comments

Comments

@valentinbld45
Copy link

I have a calendar in my Ionic application with a fixed width of 225% to let the calendar in weekView mode take up more space. When the calendar init the user sees Monday, Tuesday, Wednesday. If the user wants to see Thursday etc... he can scroll to the left to see the other days.

This works well, but now I want the calendar to automatically scrollLeft to the current day. For example if the current day is Friday, the calendar should scroll left to show Friday (like scrollToHour).

I've tried many things with no luck. Here's a simple example of the code I tested :

public scrollLeft(): void {
  const container = document.querySelector('.swiper-slide-active .weekview-normal-event-container .scroll-content') as HTMLElement;

  container.scrollLeft = 800;
}

This method is triggered by a button, once the calendar has fully loaded. The container has a total width of 810px, so with scrollLeft to 800 it should scroll to the left. But nothing happens.

I've also tried to play with the .weekview-header the same way (and other classes), put overflow-x: auto !important to some elements, played with scrollIntoView and also checked src/weekview.ts at the scrollToHour handling but it doesn't inspire me.

Any way to do it ? Thanks.

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