When updating the selectedDate
prop for EventCalendar
with props including view={{ schedule: ... }}
, the calendar autoscrolls to top. I assume this is default behaviour defined somewhere under the hood in the library.
I’d like to disable the scroll to top, and instead have a consistent experience where the user is scrolled to a specified event in the view using some effect / prop callback like:
onPageLoaded={() => {
const newEventElement = document.querySelector(
'[data-id="some-event-id"]'
)
if (newEventElement) {
newEventElement.scrollIntoView({
block: 'center',
inline: 'center',
})
}
}}
Is this possible?