This commit is contained in:
Go7hic 2019-01-05 17:18:40 +08:00 committed by 偏右
parent 16a15f696f
commit c095c3d370
4 changed files with 24 additions and 10 deletions

View File

@ -58,6 +58,8 @@ const defaultPagination = {
onShowSizeChange: noop,
};
const ROW_SELECTION_COLUMN_WIDTH = '62px';
/**
* Avoid creating new object, so that parent component's shouldComponentUpdate
* can works appropriately
@ -738,7 +740,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
render: this.renderSelectionBox(rowSelection.type),
className: selectionColumnClass,
fixed: rowSelection.fixed,
width: rowSelection.columnWidth,
width: rowSelection.columnWidth || ROW_SELECTION_COLUMN_WIDTH,
title: rowSelection.columnTitle,
};
if (rowSelection.type !== 'radio') {

View File

@ -26,7 +26,9 @@ exports[`Table.rowSelection fix selection column on the left 1`] = `
class=""
>
<colgroup>
<col />
<col
style="width:62px;min-width:62px"
/>
<col />
</colgroup>
<thead
@ -228,7 +230,9 @@ exports[`Table.rowSelection fix selection column on the left 1`] = `
class="ant-table-fixed"
>
<colgroup>
<col />
<col
style="width:62px;min-width:62px"
/>
</colgroup>
<thead
class="ant-table-thead"

View File

@ -2064,7 +2064,9 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<col
class="ant-table-expand-icon-col"
/>
<col />
<col
style="width:62px;min-width:62px"
/>
<col
style="width:150px;min-width:150px"
/>
@ -4272,7 +4274,9 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = `
class=""
>
<colgroup>
<col />
<col
style="width:62px;min-width:62px"
/>
<col />
<col
style="width:12%;min-width:12%"
@ -10935,7 +10939,9 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
class=""
>
<colgroup>
<col />
<col
style="width:62px;min-width:62px"
/>
<col />
<col />
<col />
@ -11314,7 +11320,9 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
class=""
>
<colgroup>
<col />
<col
style="width:62px;min-width:62px"
/>
<col />
<col />
<col />
@ -11963,7 +11971,9 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
class=""
>
<colgroup>
<col />
<col
style="width:62px;min-width:62px"
/>
<col />
<col />
<col />

View File

@ -294,8 +294,6 @@
&-thead > tr > th.@{table-prefix-cls}-selection-column,
&-tbody > tr > td.@{table-prefix-cls}-selection-column {
text-align: center;
min-width: 62px;
width: 62px;
.@{ant-prefix}-radio-wrapper {
margin-right: 0;
}