correct-tealC
Refine2y ago
4 replies
correct-teal

`FilterDropdown` + custom filter on Ant Design table

I was going to create a GitHub issue about this but I can't decide what the intended behavior should be.

I have an Ant Design table with a <FilterDropdown> on one of the columns. Outside of the table, I have a filter that acts on the same field that I have a FilterDropdown for.

CodeSandbox reproduction: https://codesandbox.io/p/devbox/strange-platform-5gvjz9
Steps to reproduce:
1. Open the sandbox
2. In the "Filters" section, set "Status" to "Draft" and click the "Filter" button
3. Scroll down and go to page 2
Notice how the page count changes from ~30 to ~100 because the filter was removed. This does not occur if you repeat step 2 and then open another page in a new tab by middle-clicking on the page number. Using the FilterDropdown instead of the filter in the form does not produce the issue.

In hindsight, it does seem obvious that combining a FilterDropdown with another filter on the same field shouldn't work, but the issue only occurs when changing pages, and it's not documented anywhere. Let me know what you think the expected behavior should be and I can add something to the docs or attempt to make a fix.
Was this page helpful?