Replies: 1 comment
-
I resolved this by just restructuring the HTML so that the scroll was on the window instead by using a sticky header |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having an issue trying to figure out the best solution where I've got a header (sticky) and an element with overflow:auto below it.
The normal leptos router scroll to top on navigation functionality doesn't apply - window.scrollTo(0, 0) does nothing.
Instead I need something like document().get_element_by_id().unwrap().scroll_to_with_x_and_y(0.0, 0.0).
I tried creating an Effect to listen to location using the use_location hook - but it scrolls to the top BEFORE navigating instead of after, which works but is a jarring experience.
Any ideas? I also tried waiting for is_routing to become false and that didn't seem to help.
Beta Was this translation helpful? Give feedback.
All reactions