Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MudTableSortLabel: Add FullWidth parameter#13240

Merged
danielchalmers merged 5 commits into
MudBlazor:devfrom
Will-thom:fix/table-sort-label-full-width
Jun 2, 2026
Merged

MudTableSortLabel: Add FullWidth parameter#13240
danielchalmers merged 5 commits into
MudBlazor:devfrom
Will-thom:fix/table-sort-label-full-width

Conversation

@Will-thom

Copy link
Copy Markdown

Adds a FullWidth parameter to MudTableSortLabel so the clickable sort label can fill the available table header width.

Fixes #11814

Tested with:

  • dotnet test --project src/MudBlazor.UnitTests/MudBlazor.UnitTests.csproj --no-restore /p:SkipBunCompile=true -- --filter FullyQualifiedName~TableSortLabel --output Normal --no-ansi --hangdump --hangdump-timeout 30s
  • dotnet build src/MudBlazor.Docs/MudBlazor.Docs.csproj --no-restore /p:SkipBunCompile=true --nologo
  • dotnet format whitespace --no-restore --include changed files

@mudbot mudbot Bot added API change Modifies the public API surface in a non-breaking way (ex: adds a new property) enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library labels May 22, 2026
@mudbot mudbot Bot changed the title Add full width option to MudTableSortLabel MudTableSortLabel: Add FullWidth parameter May 22, 2026

@danielchalmers danielchalmers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you post some screenshots or video?

Comment on lines +29 to +33
protected string Stylename =>
new StyleBuilder()
.AddStyle("width", "100%", FullWidth)
.AddStyle(Style)
.Build();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This inline style can be moved to src/MudBlazor/Styles/components/_table.scss by adding a class name to the CSS builder instead, e.g. mud-table-sort-label-full-width.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stylename can be reverted/removed now

@Will-thom

Copy link
Copy Markdown
Author

Added the requested screenshot for the table sorting docs showing the new FullWidth usage on MudTableSortLabel:

MudTableSortLabel FullWidth screenshot

@Will-thom

Copy link
Copy Markdown
Author

Addressed the inline style review: FullWidth now adds the mud-table-sort-label-full-width class and width: 100% lives in _table.scss. I also updated the unit test to assert the class instead of the inline style. Tested in Docker with the TableSortLabel filter: 5 tests passed.

@Will-thom

Copy link
Copy Markdown
Author

All requested changes are addressed now, and the current CI run is green. Please let me know if anything else is needed from my side.

Comment on lines +29 to +33
protected string Stylename =>
new StyleBuilder()
.AddStyle("width", "100%", FullWidth)
.AddStyle(Style)
.Build();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stylename can be reverted/removed now

Comment thread src/MudBlazor.UnitTests/Components/TableTests.cs
@Will-thom

Copy link
Copy Markdown
Author

Addressed the latest review points in 9f4f8fa: removed the Stylename wrapper so the component uses the inherited Style parameter directly again, and added a negative test asserting mud-table-sort-label-full-width is absent when FullWidth is not enabled. Local validation: git diff --check passed. I also attempted the focused TableSortLabel test in a .NET SDK 10 container, but the restore/test process timed out locally; the temporary container/image artifacts were cleaned up, so CI is the source of truth for the full run.

@danielchalmers danielchalmers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

This was referenced Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API change Modifies the public API surface in a non-breaking way (ex: adds a new property) 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.

Make MudTableSortLabel clickable across the full header width

2 participants