storybookjs/storybook

[Bug]: 7.1 Table of Contents active heading highlight broken

Open

#23,584 opened on 2023年7月25日

GitHub で見る
 (7 comments) (0 reactions) (0 assignees)TypeScript (89,909 stars) (10,058 forks)batch import
addon: docsbuggood first issuehelp wantedsev:S4

説明

Describe the bug

When there are subheadings (H3) with the same name under different headings (H2), the highlighting becomes broken, and only subheadings from the first H2 group get highlighted in the TOC as you scroll through the page.

To Reproduce

  1. Create a documentation page of a similar format:
## Button

### Properties

Lorem ipsum

### Slots

Lorem ipsum

### Events

Lorem ipsum

## Input

### Properties

Lorem ipsum

### Slots

Lorem ipsum

### Events

Lorem ipsum

## Tooltip

### Properties

Lorem ipsum

### Slots

Lorem ipsum

### Events

Lorem ipsum
  1. Add to a Storybook instance and enable TOC
  2. Observe TOC links becoming active, only links from the first group "Button" will be highlighted as you scroll past "Input" and "Tooltip"

System

System:
    OS: macOS 13.4.1
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
  Binaries:
    Node: 16.18.1 - ~/Library/Caches/fnm_multishells/66230_1690247671085/bin/node
    npm: 9.7.1 - ~/Library/Caches/fnm_multishells/66230_1690247671085/bin/npm
  Browsers:
    Chrome: 115.0.5790.102
    Edge: 114.0.1823.67
    Safari: 16.5.2
  npmPackages:
    @storybook/addon-a11y: ^7.1.0 => 7.1.0 
    @storybook/addon-essentials: ^7.1.0 => 7.1.0 
    @storybook/addon-links: ^7.1.0 => 7.1.0 
    @storybook/addons: ^7.1.0 => 7.1.0
    @storybook/theming: ^7.1.0 => 7.1.0 
    @storybook/web-components: ^7.1.0 => 7.1.0 
    @storybook/web-components-webpack5: ^7.1.0 => 7.1.0

Additional context

No response

コントリビューターガイド

[Bug]: 7.1 Table of Contents active heading highlight broken · storybookjs/storybook#23584 | Good First Issue