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

[DataGrid] Column Visibility: Update "Reset" button behavior #16626

Merged
merged 6 commits into from
Feb 17, 2025

Conversation

MBilalShafi
Copy link
Member

@MBilalShafi MBilalShafi commented Feb 16, 2025

Resolves #16072

Changelog

Breaking changes

  • The "Reset" button in the column visibility panel now resets to the initial column visibility model instead of the model when the panel was opened. The reset behavior follows these rules:

    1. If an initial columnVisibilityModel is provided, it resets to that model.
    2. If a controlled columnVisibilityModel is provided, it resets to the first model value.
    3. When the columns are updated (via the columns prop or updateColumns() API method), the reset reference point updates to the current columnVisibilityModel.

    To revert to the previous behavior, provide a custom component to the slots.columnsManagement.

@MBilalShafi MBilalShafi added breaking change component: data grid This is the name of the generic UI component, not the React module! feature: Column visibility v8.x labels Feb 16, 2025
@MBilalShafi MBilalShafi changed the title [DataGrid] Update Columns Management Reset button behavior [DataGrid] Column Visibility: Update "Reset" button behavior Feb 16, 2025
@mui-bot
Copy link

mui-bot commented Feb 16, 2025

@MBilalShafi MBilalShafi requested a review from a team February 16, 2025 14:38
Copy link
Contributor

@arminmeh arminmeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

You only need to add a record to the migration notes

@MBilalShafi MBilalShafi enabled auto-merge (squash) February 17, 2025 13:53
@MBilalShafi MBilalShafi disabled auto-merge February 17, 2025 13:53
@MBilalShafi MBilalShafi enabled auto-merge (squash) February 17, 2025 14:06
@MBilalShafi MBilalShafi merged commit be0c6ab into mui:master Feb 17, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: data grid This is the name of the generic UI component, not the React module! feature: Column visibility v8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] Column Visibility - Reset Button Confuses Users
4 participants