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

In the List Filter UI, the filter value is not invalidated when the field or operator is changed. Possibly crashing with a Range Error. #10648

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

Comments

@mfilteau
Copy link

Describe the Bug

In the List Filter UI, after adding a filter condition with field name, operator and value, if the user changes the filter name or operator, the value is not invalidated.

Some values may not be compatible with the new field / operator combination and the UI either crashes or the filter is unusable.

Image

Link to the code that reproduces this issue

https://github.com/mfilteau/payload-bugs

Reproduction Steps

  1. Seed the database

http://localhost:3000/api/seed

  1. In the admin panel, go to Orders

  2. Open the List Filter and add a filter for the Date with operator "Exists" and value "True"

  3. Change the operator to 'Equals'

-> the UI will crash with a Range Error

The same issue can be demonstrated when the value is a drop-down list populated for a relationship field. The content of the drop-down doesn't change.

https://github.com/user-attachments/assets/baba4b1b-add9-47ef-9acf-7447041c2982
https://github.com/user-attachments/assets/cf084516-3eaa-489e-914b-5f77944619cd

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

area: ui

Environment Info

Binaries:
  Node: 20.10.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  payload: 3.17.1
  next: 15.1.0
  @payloadcms/db-mongodb: 3.17.1
  @payloadcms/email-nodemailer: 3.17.1
  @payloadcms/graphql: 3.17.1
  @payloadcms/next/utilities: 3.17.1
  @payloadcms/payload-cloud: 3.17.1
  @payloadcms/richtext-lexical: 3.17.1
  @payloadcms/translations: 3.17.1
  @payloadcms/ui/shared: 3.17.1
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 65457
  Available CPU cores: 16
@mfilteau mfilteau added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Jan 17, 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