Skip to content

Arriving at the FAQ with a hash does not open that answer #46

Description

@pushpam2404

Context

Every <details> in faq.html already has an id such as #q-claim. Sending somebody that link scrolls to the question but leaves it collapsed, so they land on a closed heading and have to click. Worse, the browser may scroll to a position that then shifts as they open it.

What to change

Files: faq.html, and a small script

Requirements:

  • On load, if location.hash matches a <details> on the page, open it and scroll it into view
  • Handle the hash changing after load too, not just the initial load
  • Move focus to the opened question so keyboard and screen-reader users land in the right place
  • Do nothing if the hash does not match anything

Acceptance criteria

  • Opening faq.html#q-claim directly shows that answer expanded
  • Changing the hash without a reload opens the new one
  • Focus lands on the opened question
  • An unknown hash does not throw
  • Unaffected without JavaScript — the question is still readable, just collapsed

How to verify locally

python3 -m http.server 8000

Then open http://localhost:8000.

Difficulty

Intermediate.


New here? Comment /claim on this issue and a bot will assign it to you. Then read CONTRIBUTING.md.

Stuck at any point? Comment here saying what you have tried and where it stopped working — that is not an admission of failure, it is how we find out the instructions were unclear. You can also come to a PR Debug Clinic (Oct 12 or Oct 21).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityMaking the project usable by everyonebugSomething is brokendifficulty: intermediateRequires reading existing codedomain: os-devxOpen Source & Developer ExperiencehacktoberfestCounts toward Hacktoberfest 2026

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions