Skip to content

Scrollspy fails to activate last section at page bottom #7761

@arjuxn

Description

@arjuxn

Description

The "On this page" (scrollspy) navigation does not highlight the last heading when scrolling to the bottom of the page.

All other sections are highlighted correctly while scrolling, but the final section ("Customize") never becomes active.

Expected behavior

The last heading should become highlighted in the "On this page" navigation when it is the current section being viewed.

Actual behavior

The previous section remains highlighted even when the last heading is clearly visible on screen.

Additional context

It appears the scrollspy logic updates the active section only after a certain scroll threshold is reached.
Since the page ends shortly after the last heading, that threshold is never met.

Plugins

N/A

OpenCode version

N/A (documentation website)

Steps to reproduce

Steps to reproduce

  1. Open the documentation page
  2. Scroll down slowly through the content
  3. Observe the "On this page" navigation updating correctly for each section
  4. Reach the bottom of the page where the last heading ("Customize") is visible

Screenshot and/or share link

https://opencode.ai/docs/#customize

Image

Operating System

Windows 11

Terminal

N/A

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions