Skip to content
Bug reportOct 28, 2026· 0:23· 20 views

VitePress: 'On this page' dropdown stays open after clicking a heading link's text

0:23 total

Comments · 0

Be the first to comment.

Bug reportby SceneRecap AI

lowVitePress default theme local nav outline dropdown (VPLocalNavOutlineDropdown / VPDocOutlineItem). The close-on-click handler probably checks the event target strictly against the anchor element. A click on a child text node or inner element of the link is then not matched, so the dropdown never closes.
os: macOSdpr: 1url: /guide/what-is-vitepresslocale: en-USbrowser: Chromium 151.0.7922.34timezone: Europe/Berlinviewport: 1280x720site_version: VitePress docs 2.0.0-alpha.21

Repro steps

  1. 1.Open /guide/what-is-vitepress at a 1280x720 viewport, where the 'On this page' bar is shown collapsed.
  2. 2.Click the 'On this page' button to open the outline dropdown.
  3. 3.Click directly on the text of the 'Use Cases' outline heading link.
  4. 4.Observe that the page scrolls toward Use Cases but the dropdown stays open.
  5. 5.Control: click 'On this page' to close the dropdown, then click it again to reopen it.
  6. 6.Control: click the padding area of the 'Use Cases' row, to the right of the text.
  7. 7.Observe that the dropdown closes this time.

Expected

Clicking any part of an outline heading link in the 'On this page' dropdown, text or padding, navigates to the heading and closes the dropdown.

Actual

Clicking the link text at 8.1s scrolls the page toward Use Cases, but the dropdown stays open. It remains open at 9.0s, 11.0s and 13.0s. It only closes when the 'On this page' button is clicked again at 13.5s. Clicking the row padding at 17.3s closes the dropdown as expected.

Evidence

visualDropdown opened after clicking 'On this page'. It lists Return to top, Use Cases, Developer Experience, Performance, What About VuePress?
visualCursor is on the 'Use Cases' link text just before the click on 'Outline heading link'.
visualPage content has scrolled to the Use Cases section, but the dropdown is still open over the content.
visualDropdown is still open while the cursor hovers Developer Experience.
visualDropdown is still open while the cursor hovers Return to top.
visualDropdown is fading out after the 'On this page' button was clicked again. The Use Cases heading is visible underneath.
visualControl: the dropdown is reopened with Use Cases highlighted. The cursor is in the row padding area right of the text.
visualControl works: after the click on 'Outline heading (padding)' at 17.3s, the 'On this page' bar is collapsed and Use Cases sits at the top of the content.
Issue markdown (copy-paste ready)
## Bug: 'On this page' dropdown stays open after clicking an outline heading link's text

**Environment**
- Browser: Chromium 151.0.7922.34 on macOS
- Viewport: 1280x720, DPR 1
- Site: VitePress docs, version 2.0.0-alpha.21, `/guide/what-is-vitepress`

### Steps to reproduce
1. Open `/guide/what-is-vitepress` at a 1280x720 viewport (0.0s).
2. Click the **On this page** button to open the outline dropdown (4.4s).
3. Click directly on the text of the **Use Cases** outline link (8.1s).
4. The page scrolls to Use Cases, but the dropdown stays open (9.0s).

### Expected
Clicking an outline link navigates to the heading and closes the dropdown, wherever on the link you click.

### Actual
- After the text click at 8.1s, the dropdown is still open at 9.0s, 11.0s and 13.0s.
- It only closes when the **On this page** button is clicked again (13.5s).

### Control (works)
- After reopening the dropdown (14.7s), clicking the padding area of the Use Cases row, right of the text (17.3s), closes the dropdown and scrolls to the section (19.0s).

### Evidence
- 5.0s: dropdown open with Return to top, Use Cases, Developer Experience, Performance, What About VuePress?
- 9.0s: content scrolled to Use Cases, dropdown still overlaid.
- 13.0s: dropdown still open.
- 19.0s: after the padding click, 'On this page' is collapsed (control).

### Suggested area
Default theme local nav outline dropdown. The close handler may compare the event target strictly to the anchor. Clicks on the link's inner text or child elements would then not trigger the close.

*Recorded with SceneRecap.*

Your recordings could explain themselves too.

Free plan · silent recordings welcome · bug reports included.

Try SceneRecap free →
VitePress: 'On this page' dropdown stays open after clicking a heading link's text · SceneRecap