Skip to content

fix: preserve scroll after spa action submits#8797

Merged
wmertens merged 1 commit into
build/v2from
v2-scroll-action
Jul 3, 2026
Merged

fix: preserve scroll after spa action submits#8797
wmertens merged 1 commit into
build/v2from
v2-scroll-action

Conversation

@Varixo

@Varixo Varixo commented Jul 3, 2026

Copy link
Copy Markdown
Member

The old prevUrl came from routeLocation.prevUrl, which can still point to the route before the current page. After SPA navigation, a plain routeAction$ submit was therefore mistaken for a form navigation from a different page, causing scroll reset. Now we use the actual URL at the start of the current navigation.

@Varixo Varixo self-assigned this Jul 3, 2026
@Varixo Varixo requested a review from a team as a code owner July 3, 2026 20:48
@Varixo Varixo added the V2 label Jul 3, 2026
@maiieul maiieul moved this from Backlog to Waiting For Review in Qwik Development Jul 3, 2026
@changeset-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3f1d5d5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@qwik.dev/router Patch
eslint-plugin-qwik Patch
@qwik.dev/core Patch
create-qwik Patch
@qwik.dev/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8797

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8797

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8797

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8797

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8797

@qwik.dev/devtools

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/devtools@8797

commit: 3f1d5d5

@wmertens wmertens left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wmertens wmertens enabled auto-merge July 3, 2026 20:54
@wmertens wmertens merged commit 0733298 into build/v2 Jul 3, 2026
49 checks passed
@wmertens wmertens deleted the v2-scroll-action branch July 3, 2026 20:58
@github-project-automation github-project-automation Bot moved this from Waiting For Review to Done in Qwik Development Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 3f1d5d5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants