storybookjs/storybook
在 GitHub 查看[Bug]: 7.1 Table of Contents active heading highlight broken
Open
#23,584 建立於 2023年7月25日
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
- 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
- Add to a Storybook instance and enable TOC
- 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