Skip to content

Commit 61ef503

Browse files
committed
fix: skip fixed layout
1 parent b17ce46 commit 61ef503

5 files changed

Lines changed: 13 additions & 27 deletions

File tree

packages/components/table/BaseTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ const BaseTable = forwardRef<BaseTableRef, BaseTableProps>((originalProps, ref)
315315
}
316316
}
317317
// 没有设置任何宽度的场景下,需要保留表格正常显示的最小宽度,否则会出现因宽度过小的抖动问题
318-
if (!style.width && !col.minWidth) {
318+
if (!style.width && !col.minWidth && props.tableLayout === 'fixed') {
319319
if (isChromium()) {
320320
style.minWidth = '80px';
321321
} else {

packages/components/table/__tests__/__snapshots__/vitest-table.test.jsx.snap

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -633,15 +633,9 @@ exports[`BaseTable Component > props.tableLayout is equal to auto 1`] = `
633633
class="t-table--layout-auto"
634634
>
635635
<colgroup>
636-
<col
637-
style="width: 80px;"
638-
/>
639-
<col
640-
style="width: 80px;"
641-
/>
642-
<col
643-
style="width: 80px;"
644-
/>
636+
<col />
637+
<col />
638+
<col />
645639
</colgroup>
646640
<thead
647641
class="t-table__header"

test/snap/__snapshots__/csr.test.jsx.snap

Lines changed: 6 additions & 14 deletions
Large diffs are not rendered by default.

test/snap/__snapshots__/ssr.test.jsx.snap

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)