Replies: 2 comments
-
My example wasn't fully fleshed out. The issue seems to lie with subRows. Subrows are disappearing after filtering. Try to collapse and expand the rows with the filters applied. Any ideas @tannerlinsley ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I've created a custom filter that is supposed to hide rows with the given values:
I added the filter to my column like so:
I apply the filter using a checkbox outside the table like so:
The problem is that when i check the box after having unchecked it, the table remains filtered. It still wont show rows with Status = Finished or Suggested.
I have verified that the filter is actually removed using
state.filters
from the useTable instance.E.g
Table initially(after a page refresh):
Table when unchecked:
Table when checked again(this is the problem):
I assume this is because the rows that are passed into the filter function are the already filtered ones meaning i will only ever be able to return the already filtered rows from my custom filter function. I assumed react-table would just render all rows if no filter was applied?
What am i doing wrong here?
EDIT:
After some tinkering in codesandbox it seems like the issue lies with filters and subrows. If a filter hides subrows but not the parentrow, the hidden subrows will not be displayed again after removing the filter
See: https://codesandbox.io/s/floral-cookies-f7k8u?file=/src/App.js
Is this perhaps relevant to this issue? #2064
Beta Was this translation helpful? Give feedback.
All reactions