Skip to content

Commit 633d607

Browse files
committed
fix Chrome Table layout
close ant-design/ant-design#25227
1 parent 90adbbd commit 633d607

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Table.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,13 @@ function Table<RecordType extends DefaultRecordType>(props: TableProps<RecordTyp
475475
if (tableLayout) {
476476
return tableLayout;
477477
}
478-
if (fixHeader || fixColumn || flattenColumns.some(({ ellipsis }) => ellipsis)) {
478+
// https://github.com/ant-design/ant-design/issues/25227
479+
// When scroll.x is max-content, no need to fix table layout
480+
// it's width should stretch out to fit content
481+
if (fixColumn) {
482+
return scroll.x === 'max-content' ? 'auto' : 'fixed';
483+
}
484+
if (fixHeader || flattenColumns.some(({ ellipsis }) => ellipsis)) {
479485
return 'fixed';
480486
}
481487
return 'auto';

0 commit comments

Comments
 (0)