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

Numeric column's automatic filter autoremove interferes with manual filtering #5901

Open
2 tasks done
Faithfinder opened this issue Feb 5, 2025 · 0 comments · May be fixed by #5902
Open
2 tasks done

Numeric column's automatic filter autoremove interferes with manual filtering #5901

Faithfinder opened this issue Feb 5, 2025 · 0 comments · May be fixed by #5902

Comments

@Faithfinder
Copy link

TanStack Table version

8.20.6

Framework/Library version

18.3.0

Describe the bug and the steps to reproduce it

I'd like to implement filters with different operators for columns (e.g., a user can choose whether they want greater than or less than for numeric, for example). I'd also like to do filtering server side.

When I define a minimal column definition, the automatic filtering kicks in. Even with manualFilter turned on, autoremove logic still plays out.

For numeric columns, it treats an object as falsy due to (testFalsey(val[0]) && testFalsey(val[1]) condition.

There's a billion possible workarounds, but IMO the fix is to check whether val is an array first. This would still give bad results if somebody uses an array as filter value, but that use case is harder to imagine

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://stackblitz.com/edit/tanstack-table-8erjbq2f?file=src%2Fmain.tsx

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Yes, I am also opening a PR that solves the problem along side this issue

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
@Faithfinder Faithfinder linked a pull request Feb 5, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant