Skip to content

Commit 873b60a

Browse files
ArgoZhangclaude
andauthored
fix(Table): use auto table layout when AllowResizing is enabled (#8113)
* fix(Table): use auto table layout when AllowResizing is enabled (#8095) Revert table-layout-fixed condition to IsFixedHeader only so that tables with AllowResizing keep content-based initial column widths as before v10.6. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore(Version): bump version to 10.7.2-beta03 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent b1604fc commit 873b60a

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎src/BootstrapBlazor/BootstrapBlazor.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>10.7.2-beta02</Version>
4+
<Version>10.7.2-beta03</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

‎src/BootstrapBlazor/Components/Table/Table.razor.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public partial class Table<TItem> : ITable, IModelEqualityComparer<TItem> where
9090
.AddClass("table-excel", IsExcel)
9191
.AddClass("table-bordered", IsBordered)
9292
.AddClass("table-striped table-hover", IsStriped)
93-
.AddClass("table-layout-fixed", IsFixedHeader || AllowResizing)
93+
.AddClass("table-layout-fixed", IsFixedHeader)
9494
.AddClass("table-draggable", AllowDragColumn)
9595
.Build();
9696

‎test/UnitTest/Components/TableTest.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,7 @@ public void IsFixedHeader_Ok()
16091609
});
16101610
cut.Contains("table-fixed-header");
16111611
cut.Contains("height: 200px;");
1612+
cut.Contains("table-layout-fixed");
16121613
}
16131614

16141615
[Theory]
@@ -1745,6 +1746,9 @@ public void AllowResizing_Ok(bool resizing)
17451746
{
17461747
cut.DoesNotContain("is-resizable");
17471748
}
1749+
1750+
// 开启列宽调整时仍使用 auto 布局保持初始列宽与未开启时一致
1751+
cut.DoesNotContain("table-layout-fixed");
17481752
}
17491753

17501754
[Theory]

0 commit comments

Comments
 (0)