vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
11.48k stars 1.86k forks source link

accessibility: outline nav has duplicative assistive tech text not displayed visually #3800

Closed olets closed 2 weeks ago

olets commented 4 weeks ago

Describe the bug

The outline nav has the assistive tech text "Table of Contents for current page". Giving assistive tech users distinct or exclusive content is not recommended. In this case, the assistive tech-only text is at best duplicative (with the default outline title "On this page") and at worst conflicts with the visible text (if the outline title is configured to be something not equivalent to ~'things on this page').

Reproduction

Use a screen reader to read the outline.

Expected behavior

Assistive tech recognizes the configured outline title is as the outline's heading. No assistive tech-exclusive text duplicating displayed text is provided.

System Info

Browser issue but here you go!

System:
    OS: macOS 14.3.1
    CPU: (8) arm64 Apple M1
    Memory: 292.14 MB / 16.00 GB
    Shell: 5.9 - /opt/homebrew/bin/zsh
  Binaries:
    Node: 18.12.0 - ~/.asdf/installs/nodejs/18.12.0/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 8.19.2 - ~/.asdf/installs/nodejs/18.12.0/bin/npm
    pnpm: 8.15.6 - ~/Library/pnpm/pnpm
    bun: 1.1.4 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 123.1.64.122
    Chrome: 123.0.6312.124
    Edge: 123.0.2420.97
    Safari: 17.3.1


### Additional context

_No response_

### Validations

- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).
- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)
- [X] Read the [docs](https://vitepress.dev).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.