Skip to content

MudTable: Show the default cursor for sortable headers when sorting is disabled#10703

Merged
danielchalmers merged 6 commits intoMudBlazor:devfrom
Qwertyluk:feature/table-disabled-sort-label-cursor
Feb 5, 2025
Merged

MudTable: Show the default cursor for sortable headers when sorting is disabled#10703
danielchalmers merged 6 commits intoMudBlazor:devfrom
Qwertyluk:feature/table-disabled-sort-label-cursor

Conversation

@Qwertyluk
Copy link
Contributor

Description

Closes #10603

How Has This Been Tested?

Added unit tests and tested it visually.

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

The cursor icon for sortable table headers when sorting is enabled:

image

The cursor icon for sortable table headers when sorting is not enabled:

image

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Jan 24, 2025
@codecov
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.85%. Comparing base (0060805) to head (4844800).
Report is 28 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10703      +/-   ##
==========================================
+ Coverage   91.83%   91.85%   +0.02%     
==========================================
  Files         427      427              
  Lines       13425    13436      +11     
  Branches     2589     2594       +5     
==========================================
+ Hits        12329    12342      +13     
  Misses        523      523              
+ Partials      573      571       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danielchalmers
Copy link
Member

Is the test page empty?

image

@Qwertyluk
Copy link
Contributor Author

Qwertyluk commented Jan 27, 2025

My initial goal was to create the simplest possible test component.
However, @danielchalmers after you question, I've now made some adjustments to it so it can now be used for visual testing as well:

image

@Qwertyluk
Copy link
Contributor Author

Although I'm not sure why the tests started failing, it doesn't appear to be related to my changes.
A completely unrelated test component is failing, and it seems to also fail on the dev branch. 🤔

@danielchalmers
Copy link
Member

Thanks, I'll check this out later. You're right that the test is unrelated. I'll update the branch and that should fix it.

Copy link
Member

@danielchalmers danielchalmers left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the test.

I see there's still a hover style

Video.mp4

I'll merge after you respond either way - just curious if that's preferred or if it was not simple to change

@Qwertyluk
Copy link
Contributor Author

Qwertyluk commented Jan 29, 2025

Good point. I personally didn't consider changing other styles besides the cursor icon.

I believe it's possible to achieve, but I think different approach might be better.
Rather than overriding styles for the disabled state (as I've done so far), it should be possible to add the mud-button-root class conditionally when sorting is enabled.

Let me think about it and try it out.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2025

@Qwertyluk
Copy link
Contributor Author

@danielchalmers Hover styles should no longer be applied to disabled sorting headers.

I achieved this by adding the mud-button-root CSS class only when sorting is enabled.

Copy link
Member

@danielchalmers danielchalmers left a comment

Choose a reason for hiding this comment

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

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudTable: Remove cursor pointer icon on header cells when sorting is not enabled

3 participants