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

Checkout does not scroll to top on SPA load #97423

Closed
sirbrillig opened this issue Dec 12, 2024 · 0 comments · Fixed by #97427
Closed

Checkout does not scroll to top on SPA load #97423

sirbrillig opened this issue Dec 12, 2024 · 0 comments · Fixed by #97427
Assignees

Comments

@sirbrillig
Copy link
Member

sirbrillig commented Dec 12, 2024

Calypso is a Single Page App (SPA) so when navigating between pages, you're actually staying on the same page (as far as the browser knows) most of the time; the code just updates the URL and the page contents. As a result, when you scroll down on one page and then navigate to another which also has a scrollbar, sometimes that second page is scrolled down too (the scroll state actually just doesn't change since you're still actually on the same page).

This can be fixed by explicitly scrolling to the top when a page's top-level component renders. For example as it was done here:

#45933

Checkout does not do this and it should.

To reproduce:

  • Make a new site incognito, free. Viewport is laptop size-ish.
  • Navigate to Jetpack Stats
  • Scroll to the bottom of the screen and click the upgrade CTA.
  • Notice that checkout is scrolled part-way down the page.
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 a pull request may close this issue.

2 participants