QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.84k stars 1.31k forks source link

[🐞] Don't force restore scroll on same page #5306

Closed GrandSchtroumpf closed 4 months ago

GrandSchtroumpf commented 1 year ago

Which component is affected?

Qwik City (routing)

Describe the bug

Currently if I navigation with type pushState & scroll: false then scroll is still restored. This surely comes from here. From my understanding, it assumes that same-page navigation means hash modification only, while it could also be a searchParams change.

const nav = useNavigation();
const { url } = useLocation();
const updateSearch = $((params: Record<string, string>) => {
  const nextUrl = new URL(url);
  for (const [key, value] of Object.entries(params)) {
    nextUrl.seachParams.set(key, value);
  }
  nav(nextUrl.toString(), { type: 'pushState', scroll: false }); // scroll config ignored
})

Reproduction

qwik.new not working

Steps to reproduce

No response

System Info

System:
    OS: Windows 10 10.0.22623
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 24.03 GB / 31.71 GB
  Binaries:
    Node: 20.6.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 3.3.1 - C:\Program Files\nodejs\yarn.CMD
    npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.9.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Spartan (44.22621.1095.0), Chromium (118.0.2088.41)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @builder.io/qwik: ~1.2.13 => 1.2.13
    @builder.io/qwik-city: ~1.2.13 => 1.2.13
    undici: ^5.22.0 => 5.22.0
    vite: ~4.4.0 => 4.4.0

Additional Information

No response

gioboa commented 1 year ago

Thanks for reporting that, can you create a reproducible scenario with qwik.new pls ?

GrandSchtroumpf commented 1 year ago

Qwik.new has not been working since v1 for me, stackblitz is failing to display anything in the preview.Le 12 oct. 2023 15:47, Giorgio Boa @.***> a écrit : Thanks for reporting that, can you create a reproducible scenario with qwik.new pls ?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

wmertens commented 1 year ago

Qwik.new works for me, try cheating all application data in the devtools application tab

github-actions[bot] commented 5 months ago

Hello @GrandSchtroumpf. Please provide the missing information requested above. Issues marked with STATUS-2: missing info will be automatically closed if they have no activity within 14 days. Thanks 🙏