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
Labels
status: needs-triage
Possible bug which hasn't been reproduced yet
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.
Link to the code that reproduces this issue
https://github.com/mfilteau/payload-bugs
Reproduction Steps
http://localhost:3000/api/seed
In the admin panel, go to Orders
Open the List Filter and add a filter for the Date with operator "Exists" and value "True"
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
The text was updated successfully, but these errors were encountered: