Skip to content

[datagrid] Changing GridToolbarFilterButton variant #10409

@SammyGutierrez335

Description

@SammyGutierrez335

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Steps:

  1. Set up a data grid in a typescript file using the MUI documentation. https://mui.com/x/react-data-grid/
  2. In your component, add a slots prop and pass {toolbar: CustomToolbar}
  3. set up a CustomToolbar function that returns the code below:
<GridToolbarContainer>
  <GridToolbarColumnsButton variant="outlined" />
  <GridToolbarFilterButton variant="outlined"/>
  <GridToolbarDensitySelector variant="outlined" />
  <GridToolbarExport variant="outlined"/>
</GridToolbarContainer>

snippet of actual code in my project
image

Current behavior 😯

The Typescript compiler/IDE highlights the 'variant' prop on the GridToolbarFilterButton as an invalid prop but renders correctly. Changing the variant prop will change the look of the button as expected.
The other buttons in this custom toolbar also contain the same variant prop but do not throw an error

Expected behavior 🤔

I expect the GridToolbarFilterButton to act like the other buttons and accept the variant prop without triggering Typescript compiling error or for the data grid component to reject the prop (and varient changes) if it truly is an invalid prop.

Context 🔦

I am implementing a data grid to show various user data to supervisors.
I would like all buttons to share the same 'outlined' styling/hover effects (leveraging the prop) but if I do, the typescript error throw will impact development because each time my application renders I am forced to close out the error. This is also a block from running a build because my typescript config is setup to prevent it. My work around is to remove the prop during development/building and just informing my team that mismatch styling will hopefully be addressed later.

Your environment 🌎

npx @mui/envinfo
  npmPackages:
    @emotion/react: ^11.11.1 => 11.11.1
    @emotion/styled: ^11.11.0 => 11.11.0
    @mui/base:  5.0.0-beta.16
    @mui/core-downloads-tracker:  5.14.10
    @mui/icons-material: ^5.14.3 => 5.14.9
    @mui/lab: ^5.0.0-alpha.143 => 5.0.0-alpha.145
    @mui/material: ^5.14.10 => 5.14.10
    @mui/private-theming:  5.14.10
    @mui/styled-engine:  5.14.10
    @mui/system: ^5.14.5 => 5.14.10
    @mui/types:  7.2.4
    @mui/utils:  5.14.10
    @mui/x-data-grid:  6.14.0
    @mui/x-data-grid-premium: ^6.14.0 => 6.14.0
    @mui/x-data-grid-pro:  6.14.0
    @mui/x-date-pickers: ^6.12.1 => 6.14.0
    @mui/x-date-pickers-pro: ^6.12.1 => 6.14.0
    @mui/x-license-pro:  6.10.2
    @mui/x-tree-view:  6.0.0-alpha.1
    @types/react: ^18.2.21 => 18.2.22
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    typescript: ^4.9.5 => 4.9.5
    
    browser: google chrome

Order ID or Support key 💳 (optional)

No response

Metadata

Metadata

Assignees

Labels

breaking changeIntroduces changes that are not backward compatible.customization: cssDesign CSS customizability.plan: PremiumImpact at least one Premium user.scope: data gridChanges related to the data grid.v7.x

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions