SPA navigation keeps previous scroll position when opening another page (reproducible on liferay.com)

Hi, I would like to contribute a fix for this in liferay-portal, but I cannot create a Jira ticket (community account has no Create Issue permission on LPS/LPD). Could someone from Liferay file an LPS/LPD so I can open a PR against master?

Summary

Clicking a site navigation / footer link to another page updates the URL and content (SPA), but the viewport stays at the previous scroll position instead of going to the top.

Reproduced on

Steps

  1. Open https://www.liferay.com/
  2. Scroll to the footer
  3. Click “About Us” (goes to /company/our-story)

Expected

New page is shown from the top.

Actual

Content and title change to About Us, but scrollY stays at the bottom. history.state.scrollTop is already 0 (Liferay.SPA.app.updateScrollPosition is true), so the SPA thinks it scrolled to top, but the viewport does not.

Likely related to frontend-js-spa-web (App.js scroll restoration / focus remaining on the clicked link).

Happy to implement + add tests once there is a ticket key.