Skip to content

Do scroll restoration in userland #1550

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

Merged
merged 5 commits into from
Jun 5, 2023
Merged

Conversation

david-crespo
Copy link
Collaborator

@david-crespo david-crespo commented Jun 3, 2023

Closes #1372

Sometimes all it takes is the suggestion that something is possible and you realize it's more than possible — it's easy. Ryan Florence said scroll restoration should be possible in userland with useNavigation() and from there it took me about 10 minutes and 12 lines to get it working. This means we can scrap our annoying patch that we have to keep updating. This also fixes the Simplebar bug! I think doing scroll restoration at a slightly different, presumably later, point in time means Simplebar has had time to initialize and inflate our scrolling div to its full size.

2023-06-02-scroll-restore-fixed

@david-crespo david-crespo force-pushed the userland-scroll-restore branch from f00ec83 to f03c734 Compare June 3, 2023 02:16
@david-crespo
Copy link
Collaborator Author

very silly test

2023-06-05-scroll-restore-e2e-test

@david-crespo david-crespo force-pushed the userland-scroll-restore branch from 0ea9c50 to ae62f5c Compare June 5, 2023 16:14
@david-crespo david-crespo force-pushed the userland-scroll-restore branch from dbf0416 to f9a3248 Compare June 5, 2023 18:11
@david-crespo
Copy link
Collaborator Author

UGH

@david-crespo david-crespo force-pushed the userland-scroll-restore branch from 4ca3f6d to 3194abf Compare June 5, 2023 19:01
@david-crespo david-crespo merged commit 4636fb7 into main Jun 5, 2023
@david-crespo david-crespo deleted the userland-scroll-restore branch June 5, 2023 19:12
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.

Scroll restoration on back nav no longer works
1 participant