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

Do scroll restoration in userland #1550

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
Copy link
Collaborator Author

very silly test

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

@david-crespo
Copy link
Collaborator Author

UGH

@david-crespo david-crespo merged commit 4636fb7 into main Jun 5, 2023
6 checks passed
@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