payloadcms / payloadcms/payload

Filter Bugs

Open
#10,811 4 comments 1 reaction 2 assignees View on GitHub

Nobody has claimed this yet.

area: ui
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the Bug

Some filters either produce errors or behave in unintuitive ways.

Link to the code that reproduces this issue

https://github.com/tobiasiv/payload-reproduction/tree/filter

Reproduction Steps
  1. Clone the reproduction repo (branch: filter)
  2. Set the env variables
  3. pnpm dev
  4. Go to collection Products
  5. Apply some filters, e.g.:
  • CreatedAt "equals" current date: This returns an empty result, likely because selecting the date filter results in a different time. This behavior feels unintuitive.
  • CreatedAt "is in" and "is not in": These filters always produce an error.
  • CreatedAt: Changing any filter to or from "exists" produces an error.
  • Categories "equals", "is not equal to": These filters always produce an error.
  • Categories dropdown: The first time you open the selection dropdown, the correct suggestions are displayed. However, after switching filters, it only shows "None". This can be reset by selecting "exists" and then switching back to another filter.
  • Categories: Changing any filter from "exists" causes an error, and switching to "exists" carries over the current filter value (instead of the expected default, such as "true"). For example, the number from the previous filter remains.
  • Categories "is in" (multiple values): Selecting two values throws an error.
  • Filter removal behavior: When adding and removing a filter, the filter area remains open. However, when values are filled out in a filter and it is removed, the filter area closes. It would be more consistent for the area to stay open in this case as well.
Which area(s) are affected? (Select all that apply)

area: core

Environment Info
Binaries:
  Node: 22.13.0
  npm: N/A
  Yarn: N/A
  pnpm: 9.7.0
Relevant Packages:
  payload: 3.19.0
  next: 15.1.5
  @payloadcms/db-postgres: 3.19.0
  @payloadcms/email-nodemailer: 3.19.0
  @payloadcms/graphql: 3.19.0
  @payloadcms/next/utilities: 3.19.0
  @payloadcms/payload-cloud: 3.19.0
  @payloadcms/richtext-lexical: 3.19.0
  @payloadcms/ui/shared: 3.19.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 16263
  Available CPU cores: 8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.