Skip to content

[docs][data grid] Why was columnUnsortedIcon removed from the slots API? #19235

@duynguyen-kun

Description

@duynguyen-kun

Related page

https://mui.com/x/migration/migration-data-grid-v7/#slots

Kind of issue

Unclear explanations

Issue description

In Data Grid v7, I was able to customize the column unsorted icon via the slots API, but now it's removed without any backward compatibility or alternatives. Can you explain and at least provide a legacy prop?.

Current version: DataGrid with Pro license 8.10.1

How the code currently looks:

      const slots = useMemo<DataGridProps['slots']>(
        () => ({
          columnSortedAscendingIcon: ColumnSortedAscendingIcon, // This line applies to both ascending and unsorted icons
          columnSortedDescendingIcon: ColumnSortedDescendingIcon,
          columnUnsortedIcon: ColumnUnsortedIcon, // This line is no longer valid in v8
          ...slotsProp,
        }),
        [slotsProp],
      );

Context

The intention behind is that when hovered, the unsorted icon is the arrow pointing up and it's confusing to a group of users who think that is being sorted in ascending/descending directions. What I wanna do is to replace that with the below icon for a better visual meaning.

Image

Search keywords: data grid, docs, migration, v8, slots API, unsorted icon

Metadata

Metadata

Assignees

Labels

docsImprovements or additions to the documentation.scope: data gridChanges related to the data grid.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions