Skip to content

Conversation

@kzhgit
Copy link

@kzhgit kzhgit commented Nov 26, 2025

Description

This PR updates the column header sort icon to use the baseTooltip slot, ensuring consistency with other header icons (filter and menu icons) and enabling tooltip customization.

Problem

Previously, the sort icon used only the native browser tooltip (via the title attribute), while other header icons (filter, menu) used the baseTooltip slot. This inconsistency prevented users from customizing the sort icon tooltip appearance.

Solution

  • Wrapped GridColumnSortButton with rootProps.slots.baseTooltip in GridColumnHeaderSortIcon
  • Passed title={undefined} to GridColumnSortButton to suppress the native tooltip and prevent double tooltips
  • Added enterDelay={1000} to match the behavior of other header icons

Changes

  • Modified packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderSortIcon.tsx
  • Added regression test in packages/x-data-grid/src/tests/columnHeaders.DataGrid.test.tsx

Related Issues

Fixes #11327
Supersedes #11348 and #11349

Testing

Added a test case that verifies:

  • The sort icon is wrapped by the baseTooltip component
  • The native title attribute is removed from the button to prevent double tooltips
npx vitest run packages/x-data-grid/src/tests/columnHeaders.DataGrid.test.tsx

→ All tests pass ✅

@kzhgit kzhgit changed the title fix(data-grid): use baseTooltip slot for sort icon [DataGrid] Use baseTooltip slot for column header sort icon Nov 26, 2025
@zannager zannager added the scope: data grid Changes related to the data grid. label Nov 26, 2025
@zannager zannager changed the title [DataGrid] Use baseTooltip slot for column header sort icon [data grid] Use baseTooltip slot for column header sort icon Nov 26, 2025
@kzhgit kzhgit force-pushed the fix/data-grid-sort-icon-tooltip branch from 7520fe8 to 64196e0 Compare November 27, 2025 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: data grid Changes related to the data grid.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[data grid] ColumnHeader sorting icon has old Tooltip

2 participants