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
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).
Context
Every
<details>infaq.htmlalready 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 scriptRequirements:
location.hashmatches a<details>on the page, open it and scroll it into viewAcceptance criteria
faq.html#q-claimdirectly shows that answer expandedHow to verify locally
Then open http://localhost:8000.
Difficulty
Intermediate.
New here? Comment
/claimon 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).