Skip to content

[🐞] <Link scroll={false}... to same path still scrolls #6411

Open
@williamsdyyz

Description

@williamsdyyz

Which component is affected?

Qwik Runtime

Describe the bug

I'm trying to show dialog boxes based on a search param like
<Link href="./?dialog=about" scroll={false}>About us</Link>

I need the scroll position of the document to stay put when the user clicks the link. Unfortunately scroll={false} isn't doing that.

Reproduction

https://stackblitz.com/edit/qwik-starter-wvympk?file=src%2Froutes%2Flink-scroll%2Findex.tsx

Steps to reproduce

  1. Run npm install & npm dev.
  2. Go to the /link-scroll route in the browser
  3. Scroll down
  4. Click any link
  5. Document scrolls to top

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @builder.io/qwik: ^1.4.3 => 1.4.3 
    @builder.io/qwik-city: ^1.4.3 => 1.4.3 
    typescript: 5.3.3 => 5.3.3 
    undici: 5.28.2 => 5.28.2 
    vite: 4.5.2 => 4.5.2

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions