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

The state of the filtered list does not match the visible filter state #10329

Open
ivan-kardash opened this issue Jan 3, 2025 · 0 comments
Open
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@ivan-kardash
Copy link

Describe the Bug

There is a need set up default filter for collection, that can be removed by user.

admin -> baseListFilter doesn’t suit her because it cannot be removed.

I decided to implement my own component that sets up a default filter by updating query string parameters using useEffect. It works, and the list is filtered, but if the filter is collapsed, it does not update when the query string parameters change and user does not see actual state

Link to the code that reproduces this issue

https://github.com/ivan-kardash/empty-filter-state/tree/main/src

Reproduction Steps

Steps:
• Create a user with the admin role.
• Create a user with the editor role.
• Update the list with a collapsed filter.

AS IS:
The list is filtered, but after unfolding, the filter is empty.
With an unfolded filter, it works correctly (check the attached video).

SHOULD BE:
The list is filtered, and after unfolding, the filter should maintain a valid state (check the attached video).

Attach
https://github.com/user-attachments/assets/97b41e7b-7b2d-4b15-974d-08944b3b5409

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

area: ui

Environment Info

Binaries:
  Node: 20.15.0
  npm: 10.7.0
  Yarn: 1.22.22
  pnpm: 9.15.2
Relevant Packages:
  payload: 3.9.0
  next: 15.1.0
  @payloadcms/db-postgres: 3.9.0
  @payloadcms/email-nodemailer: 3.9.0
  @payloadcms/graphql: 3.9.0
  @payloadcms/next/utilities: 3.9.0
  @payloadcms/payload-cloud: 3.9.0
  @payloadcms/richtext-lexical: 3.9.0
  @payloadcms/translations: 3.9.0
  @payloadcms/ui/shared: 3.9.0
  react: 19.0.0
  react-dom: 19.0.0
@ivan-kardash ivan-kardash added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant