Scrollspy fails to activate last section at page bottom #4708

Open
opened 2026-02-16 17:45:08 -05:00 by yindo · 0 comments
Owner

Originally created by @arjuxn on GitHub (Jan 11, 2026).

Originally assigned to: @jayair on GitHub.

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

Originally created by @arjuxn on GitHub (Jan 11, 2026). Originally assigned to: @jayair on GitHub. ### 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 <img width="1866" height="958" alt="Image" src="https://github.com/user-attachments/assets/c61278eb-a030-4d4a-a592-bc219882a822" /> ### Operating System Windows 11 ### Terminal N/A
yindo added the bugdocs labels 2026-02-16 17:45:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4708