Skip to content

Link from "Copy link to highlight" does not scroll to the highlighted text #5082

@moktavizen

Description

@moktavizen

Describe the bug

When opening link from "Copy link to highlight", the viewport does not scroll to the highlighted text. I tested this issue on several browsers:

  • Chromium (Linux) = yes, does not scroll.
  • Vivaldi (Linux) = yes, does not scroll.
  • Safari (iOS 18) = yes, does not scroll.
  • Firefox (Linux) = no, works as expected.
  • Zen (Linux) = no, works as expected.

Reproduction

  1. Restart browser
  2. Open link from "Copy link to highlight", such as:

Expected behavior

The text is scrolled into view and highlighted with color.

System Info

System:
    OS: Linux 6.12 Arch Linux
    CPU: (8) x64 Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz
    Memory: 10.74 GB / 15.44 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 25.2.1 - /usr/bin/node
    npm: 11.7.0 - /usr/bin/npm
    pnpm: 10.25.0 - /usr/bin/pnpm
    Deno: 2.6.2 - /usr/bin/deno
  Browsers:
    Chromium: 143.0.7499.192
    Firefox: 146.0.1
    Firefox Developer Edition: 146.0.1

Additional context

Reproduction video

vitepress-link-issue.mp4

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions