xobotyi/react-scrollbars-custom

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

stevenmunro opened this issue · 1 comments

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?

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.