Skip to content

Commit

Permalink
fix(table): Fix the issue where align="center" is not working
Browse files Browse the repository at this point in the history
close #6515
  • Loading branch information
chenshuai2144 committed Jul 16, 2023
1 parent bc94215 commit db6fc65
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
2 changes: 2 additions & 0 deletions packages/table/src/utils/columnRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ export function columnRender<T>({
display: 'flex',
alignItems: 'center',
gap: marginSM,
justifyContent:
columnProps.align === 'center' ? 'center' : 'flex-start',
}}
>
{editableUtils.actionRender({
Expand Down
4 changes: 2 additions & 2 deletions tests/form/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -53077,7 +53077,7 @@ exports[`form demos 📸 renders ./packages/form/src/demos/pro-form-editableTabl
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -53301,7 +53301,7 @@ exports[`form demos 📸 renders ./packages/form/src/demos/pro-form-editableTabl
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down
40 changes: 20 additions & 20 deletions tests/table/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5479,7 +5479,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -5741,7 +5741,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -6003,7 +6003,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -6265,7 +6265,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -6527,7 +6527,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -6789,7 +6789,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -7051,7 +7051,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -7313,7 +7313,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -7575,7 +7575,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -7837,7 +7837,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -8099,7 +8099,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -8361,7 +8361,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -8623,7 +8623,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -8885,7 +8885,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -9147,7 +9147,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -9409,7 +9409,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -9671,7 +9671,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -9933,7 +9933,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -10195,7 +10195,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down Expand Up @@ -10457,7 +10457,7 @@ exports[`table demos 📸 renders ./packages/table/src/components/EditableTable/
class="ant-table-cell"
>
<div
style="display: flex; align-items: center; gap: 12px;"
style="display: flex; align-items: center; gap: 12px; justify-content: flex-start;"
>
<a>
删除
Expand Down

0 comments on commit db6fc65

Please sign in to comment.