research-software-directory / RSD-as-a-service

This repo contains the new RSD-as-a-service implementation
https://research.software
22 stars 15 forks source link

Don't scroll to top of the website when changing page in software overview #1113

Closed cmeessen closed 5 months ago

cmeessen commented 5 months ago

Fixes #1112

Changes proposed in this pull request:

How to test:

PR Checklist:

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed for 'rsd-frontend'

Issues
0 New issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

jmaassen commented 5 months ago

When I switch to a different page, it first scrolls all the way to the top, and then scrolls down again to the level of "All software". This extra movement makes the page switching very "jumpy". Is there a way to jump to "All software" at once?

cmeessen commented 5 months ago

Firefox immediately jumps to "All software", but I can confirm that in Chromium the browser first jumps to the top and then scrolls down.

cmeessen commented 5 months ago

If you set scroll: false in useSoftwareOverviewParams.ts, Chromium scrolls from the bottom of the page to "All software" on page change. Firefox still behaves the same.

// Line 37:
    if (key === 'page') {
      // when changin page we scroll to top
      router.push(url+'#list-top', url+'#list-top', {scroll: false})
    }
cmeessen commented 5 months ago

Closing in favour of #1114