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

[data grid] Header Filters empty / no UI once isEmpty or isNotEmpty is selected #14490

Closed
brandoningli opened this issue Sep 5, 2024 · 4 comments · Fixed by #14493
Closed
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Filtering on header Related to the header filtering (Pro) feature regression A bug, but worse support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@brandoningli
Copy link

brandoningli commented Sep 5, 2024

Steps to reproduce

Link to live example (Documentation site)

Steps:

  1. Find the first DataGrid on the example page, in which you can change the header filter to Is Empty
  2. For any column, select either Is Empty or Is Not Empty

Current behavior

The header filter is blank. There is no UI element.

Expected behavior

A UI element is rendered to allow the user to switch to another filter or no filter at all.

Context

We disabled the main filter panel as our users in particular found it a bit complicated and solely using header filters worked better with our UX. This means that when they select Is Empty or Is Not Empty, they now cannot remove or change that filter unless they refresh the page.

Your environment

Using Firefox 130.0

npx @mui/envinfo
System:
    OS: macOS 14.6.1
  Binaries:
    Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
    npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 128.0.6613.114
    Edge: Not Found
    Safari: 17.6
  npmPackages:
    @emotion/react: ^11.10.0 => 11.13.0 
    @emotion/styled: ^11.10.0 => 11.13.0 
    @mui/base: ^5.0.0-beta.23 => 5.0.0-beta.40 
    @mui/core-downloads-tracker:  5.16.6 
    @mui/icons-material: ^5.8.4 => 5.16.6 
    @mui/lab: ^5.0.0-alpha.114 => 5.0.0-alpha.173 
    @mui/material: ^5.9.2 => 5.16.6 
    @mui/private-theming:  5.16.6 
    @mui/styled-engine:  5.16.6 
    @mui/system:  5.16.6 
    @mui/types:  7.2.15 
    @mui/utils:  5.16.6 
    @mui/x-data-grid:  7.12.0 
    @mui/x-data-grid-pro: ^7.1.1 => 7.12.0 
    @mui/x-date-pickers:  7.12.0 
    @mui/x-date-pickers-pro: ^7.1.1 => 7.12.0 
    @mui/x-internals:  7.12.0 
    @mui/x-license:  7.12.0 
    @types/react: ^18.2.45 => 18.3.3 
    react: ^18.2.0 => 18.3.1 
    react-dom: ^18.2.0 => 18.3.1 
    styled-components:  6.1.12 
    typescript: ^5.3.3 => 5.5.4 

Search keywords: header filter isEmpty
Order ID: 75000

@brandoningli brandoningli added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 5, 2024
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Sep 5, 2024
@k-rajat19
Copy link
Contributor

Thanks for your feedback.
This happens because the isEmpty and isNotEmpty values in the filter operator have no Input Component.
this behavior is for better UX but in your case, it seems like a problem because you have disabled the main filter panel.
we should probably disable the input component for these values instead of not rendering it.

@michelengelen michelengelen added feature: Filtering on header Related to the header filtering (Pro) feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 5, 2024
@michelengelen michelengelen changed the title Header Filters empty / no UI once isEmpty or isNotEmpty is selected [data grid] Header Filters empty / no UI once isEmpty or isNotEmpty is selected Sep 5, 2024
@brandoningli
Copy link
Author

I was just able to patch this into my codebase to test it out, and those improvements are exactly what the doctor ordered!

@MBilalShafi
Copy link
Member

I think it's a regression as it used to work in v6: https://v6.mui.com/x/react-data-grid/filtering/header-filters/

@MBilalShafi MBilalShafi added regression A bug, but worse and removed bug 🐛 Something doesn't work labels Sep 6, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

We value your feedback @brandoningli! How was your experience with our support team?
If you could spare a moment, we'd love to hear your thoughts in this brief Support Satisfaction survey. Your insights help us improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Filtering on header Related to the header filtering (Pro) feature regression A bug, but worse support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
4 participants