Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search query is not preserved when navigating back to list view #9132

Open
dietmarweiss opened this issue Nov 12, 2024 · 0 comments
Open

Search query is not preserved when navigating back to list view #9132

dietmarweiss opened this issue Nov 12, 2024 · 0 comments
Assignees
Labels

Comments

@dietmarweiss
Copy link

dietmarweiss commented Nov 12, 2024

Describe the Bug

When you use the search or filter feature on a collection's list view, click an item from the results and then navigate back,
the search (or filter) query params briefly appear in the Browsers' URL bar but then quickly disappear, losing the search (or filter) state.

This issue has been reported before (#8086) and was apparently fixed, but seems to have resurfaced.

Link to the code that reproduces this issue

https://github.com/dietmarweiss/payload-query-params-lost

Reproduction Steps

  1. Run pnpm install to install dependencies
  2. Run pnpm dev _community to start the admin panel
  3. navigate to the 'Posts' list view (http://localhost:3000/admin/collections/posts)
  4. Enter "example" in the search field (or navigate to http://localhost:3000/admin/collections/posts?limit=10&page=1&search=example)
  5. Click on the (only) item from the list
  6. Navigate back

Expected behaviour:
The Browser's URL bar preserves the "search" query param

Actual behaviour:
The "search" param briefly appears but is then removed from the URL

Which area(s) are affected? (Select all that apply)

area: ui

Environment Info

Binaries:
  Node: 22.6.0
  npm: 10.8.2
  Yarn: N/A
  pnpm: 9.7.1
Relevant Packages:
  payload: 3.0.0-beta.127
  next: 15.0.0
  @payloadcms/db-postgres: 3.0.0-beta.127
  @payloadcms/live-preview: 3.0.0-beta.127
  @payloadcms/live-preview-react: 3.0.0-beta.127
  @payloadcms/next/utilities: 3.0.0-beta.127
  @payloadcms/ui/shared: 3.0.0-beta.127
  react: 19.0.0-rc-65a56d0e-20241020
  react-dom: 19.0.0-rc-65a56d0e-20241020
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 10
screen-recording.mp4
@dietmarweiss dietmarweiss added status: needs-triage Possible bug which hasn't been reproduced yet v3 validate-reproduction labels Nov 12, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants