Sage-Bionetworks / sage-monorepo

Where OpenChallenges, Schematic, and other Sage open source apps are built
https://sage-bionetworks.github.io/sage-monorepo/
Apache License 2.0
22 stars 12 forks source link

[Bug] Challenge & org pages jump to the top when selecting a section ⭐ #2310

Closed tschaffter closed 10 months ago

tschaffter commented 10 months ago

Is there an existing issue for this?

What product(s) are you seeing the problem on?

OpenChallenges

Current behavior

Challenge & org pages jump to the top when selecting a section

Expected behavior

The scrolling position should not be reset when selecting a section.

Anything else?

We should be able to fix this bug using Location as we do on the search pages.

Commit ID

7ae8482caa921c479f38b5cc0f871baf5334d2e4

Are you developing inside the dev container?

Code of Conduct

tschaffter commented 10 months ago

@rrchai Related to this issue, clicking on one of the tabs of a challenge page will update the URL with a query parameters that points to the section. However, reloading this URL won't restore the tab.

Example:

  1. Go to http://localhost:8000/challenge/280/stanford-ribonanza-rna-folding
  2. Click on the tab Contributors.
    • The URL becomes: http://localhost:8000/challenge/280?tab=contributors
    • Notice that the challenge slug disappeared from the URL
  3. Reload the page with the url http://localhost:8000/challenge/280?tab=contributors
    • Actual: the Overview tab is active http://localhost:8000/challenge/280/stanford-ribonanza-rna-folding
    • Expected: the Contributors tab should be active

We can track this issue in a separate ticket if you prefer.