-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Add icons to FilterButton dropdown #10186
Conversation
…le state if applied
packages/ra-ui-materialui/src/list/filter/FilterButton.spec.tsx
Outdated
Show resolved
Hide resolved
@@ -74,13 +80,18 @@ export const FilterButton = (props: FilterButtonProps) => { | |||
} | |||
|
|||
const hiddenFilters = filters.filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be renamed. allTogglableFilters
?
setTimeout(() => { | ||
const inputElement = document.querySelector( | ||
`input[name='${source}']` | ||
) as HTMLInputElement; | ||
if (inputElement) { | ||
inputElement.focus(); | ||
} | ||
}, 50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to focus the filter input that we just removed?
Besides, the tests are failing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're missing tests about removing filters:
- Removing from the filter button we already had should uncheck its matching item in the menu
- Unchecking an applied filter from the menu should remove it (both the input and the filter value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
packages/ra-ui-materialui/src/list/filter/FilterButton.spec.tsx
Outdated
Show resolved
Hide resolved
packages/ra-ui-materialui/src/list/filter/FilterButton.spec.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
Problem
There is no way to differentiate between filter choices and filter actions (such as save current query) in the FilterButton
when you select a filter, it disappears from the list, which changes the place of each choice item and makes it hard to remember where is the filter you want to enable ; same for the actions (Remove all filters)
To Do
Additional Checks
master
for a bugfix, ornext
for a feature- [ ] The documentation is up to date