Skip to content

Fix sticky TOC scrolling after app-pane wrapper removal - #538

Open
gonogo wants to merge 5 commits into
alphagov:mainfrom
gonogo:fix/sticky-toc-scroll-with-footer
Open

gonogo wants to merge 5 commits into
alphagov:mainfrom
gonogo:fix/sticky-toc-scroll-with-footer

Conversation

@gonogo

@gonogo gonogo commented Sep 13, 2026

Copy link
Copy Markdown

Restore an independently scrollable sidebar without locking the viewport, so the full-width footer scrolls into view with the page.

Proposed changes

Restore an independently scrollable sidebar without locking the
viewport, so the full-width footer scrolls into view with the page.
@JC-DSIT

JC-DSIT commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@gonogo - thanks for the PR, a couple of issues I noticed in the screen grab below :)

Toc.Review.mp4

@JC-DSIT JC-DSIT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See screen recording attached to PR comments.

  • border is not consistent
  • screen bounces on long ToC

Scroll the active nav item within the sidebar pane only, instead of using
scrollIntoView, so a long TOC no longer fights window scroll.
@gonogo

gonogo commented Sep 17, 2026

Copy link
Copy Markdown
Author

Good spot, have now fixed footer issue. Not sure what you mean about inconsistent border though? Can you clarify? Thanks

@JC-DSIT

JC-DSIT commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Good spot, have now fixed footer issue. Not sure what you mean about inconsistent border though? Can you clarify? Thanks

Thanks @gonogo - regarding the border these screenshots may be clearer:

Toc Prod Toc Error 2 ToC error 1

Either the right border of the ToC container needs to be visible for the full length at all times, or the left border of the main content. It doesn't really matter which so long as the result is the same, so whichever is easier/most sensible

@JC-DSIT

JC-DSIT commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

@gonogo - is there any update on this?

@JC-DSIT JC-DSIT added this to the 6.6.0 milestone Oct 7, 2026
Draw the same border on the left of the content instead of the right of the table of contents.
@gonogo

gonogo commented Oct 9, 2026

Copy link
Copy Markdown
Author

@JC-DSIT Have updated, moved the border - previously it was on the right of the TOC, now it's on the left of the content so it appears consistently regardless of the length of either the content or the TOC.

@gonogo
gonogo requested a review from JC-DSIT October 14, 2026 21:14

@JC-DSIT JC-DSIT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @gonogo - i did review the changes and the border for the table os contents is still not consistent - you can see this if you use the example documentation site and play around with expanding the ToC headings.

When we have a chance we will take a look and see if there is a better solution. In the meantime if you do make any more changes let us know

@JC-DSIT
JC-DSIT marked this pull request as draft October 15, 2026 08:14
When the page is shorter than the table of contents, the border stopped at the content. Stretching that column makes the divider run the full height of the row.
@gonogo

gonogo commented Oct 15, 2026

Copy link
Copy Markdown
Author

@JC-DSIT Sorry I missed this before, have now reworked it using the example site to test it. Have fixed the issue by stretching the content pane so it always reaches the footer even if it's shorter than the table of contents. Have tested with the example site.

@gonogo
gonogo marked this pull request as ready for review October 15, 2026 10:44

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Fix scrolling behaviour so navigation scrolls independently of content

2 participants