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

Should mimic behaviour of window.scrollTo(0, 0); #150

Open
stevenmunro opened this issue Jun 22, 2020 · 1 comment
Open

Should mimic behaviour of window.scrollTo(0, 0); #150

stevenmunro opened this issue Jun 22, 2020 · 1 comment

Comments

@stevenmunro
Copy link

window.scrollTo(0, 0); sends the page to the top. With react-scrollbars-custom enabled on the body element, this does not happen.

Could there be a prop we could pass to make it listen to window.scrollTo calls?

@xobotyi
Copy link
Owner

xobotyi commented Jun 22, 2020

I'd say that this functionality should be implemented on your side, since it will involve window function wrapping.
Event listening will not work because window.scrollTo will try to scroll body element which does not have any scroll therefore it should not emit scroll event.

For past 3 years you're the first person who asked for such functionality. BTW why not to use RSC's context API to control parent scrollbars.

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

2 participants