Skip to content

[data grid] Multi sorting not working when using the dropdown menu #19002

@rhyswatsonto

Description

@rhyswatsonto

Steps to reproduce

Steps:

  1. Open this link to live example: https://mui.com/x/react-data-grid/sorting/#multi-sorting
  2. Scroll down to the second example -where multipleColumnsSortingMode prop is set to "always".
  3. Click on multiple column headers to sort 3 columns. Image
  4. For a column that is not sorted open the dropdown menu and click "Sort by ASC" or "Sort by DESC" Image
  5. Then instead of making this column the fourth sorted column it unsorts all other columns and makes this column the only column that is sorted
Image

Current behavior

Currently if multiple columns are sorted when multipleColumnsSortingMode='always', when sorting a new column using the columns dropdown menu it unsorts all other columns and makes the new column the only one that is sorted.

Expected behavior

When multipleColumnsSortingMode='always', if I have multiple columns being sorted and I chose to sort a new column by using the columns dropdown menu, I expect that this new column will be added as a sorted column while also retaining all previously sorted columns.

Context

I am trying to make the behavior consistent for the user when multipleColumnsSortingMode='always'. In these scenarios multiple columns will be sorted at once and work would be lost if those columns become unsorted.

Your environment

It is from the examples in the MUI docs https://mui.com/x/react-data-grid/sorting/#multi-sorting

Search keywords: sorting multi multipleColumnsSortingMode dropdown

Metadata

Metadata

Assignees

Labels

feature: SortingRelated to the data grid Sorting featurescope: data gridChanges related to the data grid.type: bugIt doesn't behave as expected.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions