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

feat: reset scroll on player navigation #929

Closed
wants to merge 1 commit into from

Conversation

pyphilia
Copy link
Contributor

I really tried to make tanstack-router work with their scrollRestoration feature.
However we need the scrollToTopSelectors prop https://tanstack.com/router/latest/docs/framework/react/guide/scroll-restoration#hashtop-of-page-scrolling but it doesn't seem to exist in the current version? We need this prop because it is not the window that needs scrolling, but the main element (window is always scroll: 0, we fake scrolling with a div because of the drawer).

So currently my solution is a dirty useEffect on each itemIdchange.

Another alternative could be to change the whole structure of the <Main /> component, where the header and drawer are inside some div in fixed, while the div handles margin and scroll.. let me know what you think.

close #928

@pyphilia pyphilia requested a review from spaenleh February 14, 2025 16:04
@pyphilia pyphilia self-assigned this Feb 14, 2025
Copy link

@pyphilia pyphilia closed this Feb 18, 2025
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

Successfully merging this pull request may close these issues.

Reset scroll on player navigation
1 participant