-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGridPro] Filtering on Column Header #7760
Conversation
Localization writing tips ✍️Seems you are updating localization 🌍 files. Thank you for contributing to the localization! 🎉 To make your PR perfect, here is a list of elements to check: ✔️
Netlify deploy previewNetlify deploy preview: https://deploy-preview-7760--material-ui-x.netlify.app/ Updated pagesThese are the results for the performance tests:
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@MBilalShafi I checked it one more time - looks solid, and nicely done. |
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.
Great work, @MBilalShafi! 🎉
Thanks everyone who contributed for the great review feedback to shape this PR up 🙏 |
@MBilalShafi From the perspective of an end-user, I think that this is an input inside an header. The notion of header cell sounds more like an implementation detail. As an end user, I would span Enter to make my filter query is executed. A blur would suspire me (how I found this). |
onFocus={() => apiRef.current.startHeaderFilterEditMode(colDef.field)} | ||
onBlur={() => apiRef.current.stopHeaderFilterEditMode()} | ||
placeholder={apiRef.current.getLocaleText('columnMenuFilter')} | ||
label={isFilterActive ? capitalize(label) : ' '} |
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.
I think that we should change this logic, turning the label to an empty string breaks the floating label animation. Instead, it's better to control the shrink state.
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.
Agreed, one reason it happens is that label also changes on focus (e.g Filter
-> Contains
), added to the list of follow-up items.
Closes #6247
isAnyOf
operator for this PR (Will be handled in: [DataGridPro] Filtering on the Header followup actions #9034)unstable_
colDef.renderHeaderFilter
and polish documentationNice to Haves (recommendations will be appreciated):
/internals
(avoid eslint comment)Issue: #6247
Designs: https://www.figma.com/proto/W6TItYkiGJZjL5zLnfeSjy/Data-grid?node-id=1024%3A44648&scaling=scale-down-width&page-id=650%3A35241&starting-point-node-id=905%3A40731
Preview
https://deploy-preview-7760--material-ui-x.netlify.app/x/react-data-grid/filtering/#header-filters
Changelog
DataGridPro
:Screen.Recording.2023-05-18.at.6.35.47.PM.mov
Screen.Recording.2023-05-18.at.7.32.29.PM.mov
See the documentation for more details.