You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The useElementScrollRestoration hook consistently returns undefined even when properly implemented with a valid data-scroll-restoration-id. The hook should return scroll position data for elements marked with the proper data attribute, but it fails to capture or return any scroll position information.
@johnstack94 upon retesting using the reproduction provided, this feature is working as expected. See screen capture below.
Screen.Recording.2024-11-15.at.23.10.51.mov
For a scroll restoration to happen, you need to have gone back to the page in question.
For example, if you perform the steps of "Go to home", "Scroll down", "Go to about", and then "Go to home", then you've never actually performed a restoration (back navigation). So a restoration doesn't happen here, since the instructions the browser is getting is "Forward", "Forward", "Forward".
For restoration to happen in this instance, the order of steps needs to be "Go to home", "Scroll down", "Go to about", and then "Press the back button". Over here, the browser is being told "Forward", "Foward", "Back".
Which project does this relate to?
Router
Describe the bug
The useElementScrollRestoration hook consistently returns undefined even when properly implemented with a valid data-scroll-restoration-id. The hook should return scroll position data for elements marked with the proper data attribute, but it fails to capture or return any scroll position information.
Your Example Website or App
https://stackblitz.com/edit/github-dc3gr8?file=src%2Froutes%2Findex.tsx
Steps to Reproduce the Bug or Issue
Expected behavior
Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: