qwik icon indicating copy to clipboard operation
qwik copied to clipboard

fix(qwik-city): Fix client-side redirects with search params

Open octet-stream opened this issue 1 year ago • 3 comments
trafficstars

Overview

I am not sure if my issue is related to #6103, so I decided open a PR with the fix for my issue. This PR changes how qwik-city-component handles URLSearchParams changes within same route segment.

What is it?

  • [ ] Feature / enhancement
  • [x] Bug
  • [ ] Docs / tests / types / typos

Description

This PR replaced isSamePathname with isSamePath so that the URL will be updated after redirect.

Use cases and why

Current behavior: When action redirects within same route segment, and only changes URLSearchParams, Qwik ignores the change of the URL, but the data on the page is updated.

After this change: The Qwik updates the URL, along with data refresh, just the way it works in browsers.

Reproduction demo can be found here: https://stackblitz.com/edit/qwik-redirects-er3vm8-36vtnr?file=src%2Froutes%2Flayout.tsx&view=editor

Checklist:

  • [x] My code follows the developer guidelines of this project
  • [x] I have performed a self-review of my own code
  • [ ] I have made corresponding changes to the documentation
  • [x] Added new tests to cover the fix / functionality

octet-stream avatar May 27 '24 17:05 octet-stream