I'm using fullcalendar v5 and I'm trying to scroll the window to the current day element using the viewDidMount hook. It finds the element via "fc-day-today" class, but when calling scrollIntoView, nothing happens.
Full calendar option (registering method on the hook):
viewDidMount: this.scrollToCurrentDay,
My code to scroll:
// scrollToCurrentDay
var element = document.getElementsByClassName('fc-day-today');
element[0].scrollIntoView();
If I wrap the scrollIntoView() call in a timeout, then it works, but I don't want to do this since it seems hacky.
Any help?