alphagov / alphagov/tech-docs-template

Navigation menu highlight disappears when scrolling to the next heading

Open
#236 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
84
Forks
36
Avg merge
10h 56m
Merged PRs (30d)
2

Description

What should change

At the moment, the left-hand navigation menu displays a page's H2 headings. It highlights the heading you are currently looking at. For example, this H2 in the Pay documentation.

However, when you scroll to a non-H2 heading, the highlight in the navigation menu disappears. The highlight only reappears when you reach the next H2.

Expected behaviour should be that the highlight remains even if you have hit another heading lower in the heading hierarchy, as they were 'contained' within the previous heading.

User need

This issue came up with a couple of developers during research for GOV.UK Pay's recurring payments work.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the disappearing highlight in the left-hand navigation using the linked Pay documentation, then trace the template's navigation highlighting entry point and its handling of H2 and lower-level headings. Done means the previous H2 remains highlighted while scrolling through headings contained within it, until the next H2 is reached.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.