Hi everyone,
I’ve been working with vaadin-grid in a React application and ran into a limitation.
I have a paginated grid, when the user navigates between pages, I reset the scroll position back to the top using scrollToIndex(0), which works correctly and is straightforward to use:
gridRef.current?.scrollToIndex(0)
The scroll jump is instantaneous. I’d like to provide a smoother UX, similar to what the browser natively offers via scrollTo({ top: 0, behavior: "smooth" }) on a regular DOM element.
scrollToIndex doesn’t appear to accept any options object, so there’s no obvious way to pass a scroll behavior hint.
I try applying scroll-behavior: smooth via CSS on the host element doesn’t work because the scroll container lives inside the component’s Shadow DOM, and don’t have exported part name.
Is this something that could be considered as a future enhancement — perhaps an options parameter like scrollToIndex(0, { behavior: 'smooth' })?
Thanks in advance for any guidance!