Skip to content

Commit 27d65b3

Browse files
ljmay168ArgoZhang
andauthored
fix(Table): column auto-fit width not working on detail mode (dotnetcore#6878)
* fix(Table):表格列适应列宽在表格明细行中有嵌套表格时不正常 dotnetcore#6877 * chore: bump version 9.11.2-beta04 --------- Co-authored-by: Argo Zhang <[email protected]>
1 parent a31fcaa commit 27d65b3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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>9.11.2-beta03</Version>
4+
<Version>9.11.2-beta04</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/Table/Table.razor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,14 +730,14 @@ const autoFitColumnWidth = async (table, col) => {
730730
const index = indexOfCol(col);
731731
let rows = null;
732732
if (table.thead) {
733-
rows = table.body.querySelectorAll('table > tbody > tr:not(.is-detail)');
733+
rows = [...table.tables[1].tBodies[0].rows].filter(x => !x.classList.contains('is-detail'));
734734
}
735735
else {
736-
rows = table.tables[0].querySelectorAll('table > tbody > tr:not(.is-detail)');
736+
rows = [...table.tables[0].tBodies[0].rows].filter(x => !x.classList.contains('is-detail'));
737737
}
738738

739739
let maxWidth = 0;
740-
[...rows].forEach(row => {
740+
rows.forEach(row => {
741741
const cell = row.cells[index];
742742
maxWidth = Math.max(maxWidth, calcCellWidth(cell));
743743
});

0 commit comments

Comments
 (0)