-
Hey all, Checking in because I ran into a question when running through the filter group examples today: https://codesandbox.io/s/default-filter-group-rloskb?file=/src/components/DefaultFilterGroup.tsx Reproduction steps:
result: the searchbar is cleared Next:
result: Question from my side: Is The reason I ask is because we had someone put all of the filters for a page on one line. In the case where Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Disclaimer: This is a very experimental bot using OpenAI's GPT-4. The answers may not be correct, a human will review the answer and update it if necessary. Hello! The "Clear Filter" button is designed to revert all filter parameters back to their default state. In the case of the search bar, its default state is empty. So, when you click "Clear Filter", it should indeed clear the search bar. Here's the relevant part from the documentation:
As for the "Clear Filter" button being disabled after typing a value into the search bar, it should actually be enabled. The button is designed to be in the disabled state on page load, and would enable when at least one of the filter parameters value is changed from the previous state. Here's the relevant part from the documentation:
So, in your case, if the "Clear Filter" button is not enabling after typing into the search bar, it might be a bug. I hope this helps! Let me know if you have any other questions. Here are some similar discussions:
|
Beta Was this translation helpful? Give feedback.
-
Hi @jalexy12 I think, honestly, it's an old example and it's a little buggy. I get why we probably disabled the buttons, but our own guidance is that you shouldn't, ever. Coupled with the fact there is a bug in that logic, where other filters enable the Apply button when a value is selected, but the search field does not, makes this whole thing kind of confusing. Worth noting that the "clear" button is actually labelled "Clear all" so the intention is that it clears all filters for the list view. Ultimately, they should all be the same. Search is a filter, just like the rest. The filtering should only occur on submit or press of apply. The "Clear all" button should reset all filters. I might say that the search filter could be improved by having it's own clear button, just like unselecting a value in the other fields. And, I suspect, "Clear all" is probably not the best button text and could be improved. Maybe it should read "Reset filters"? We'll be updating these in the future, so thanks for stress testing these for us! |
Beta Was this translation helpful? Give feedback.
Hi @jalexy12
I think, honestly, it's an old example and it's a little buggy.
I get why we probably disabled the buttons, but our own guidance is that you shouldn't, ever. Coupled with the fact there is a bug in that logic, where other filters enable the Apply button when a value is selected, but the search field does not, makes this whole thing kind of confusing.
Worth noting that the "clear" button is actually labelled "Clear all" so the intention is that it clears all filters for the list view.
Ultimately, they should all be the same. Search is a filter, just like the rest. The filtering should only occur on submit or press of apply. The "Clear all" button should reset all filters.
I mi…