Skip to content

Commit

Permalink
fix(table): fix renderFormItem render twice render time
Browse files Browse the repository at this point in the history
close #7300
  • Loading branch information
chenshuai2144 committed Jul 18, 2023
1 parent 3f5cbe6 commit c3b8ffd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
4 changes: 1 addition & 3 deletions packages/table/src/utils/cellRenderToFromItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,7 @@ const CellRenderFromItem = <T,>(props: CellRenderFromItemProps<T>) => {
type: 'table',
},
{
defaultRender: () => (
<InlineItem {...formItemProps}>{fieldDom}</InlineItem>
),
defaultRender: () => <>{fieldDom}</>,
type: 'form',
recordKey,
record: {
Expand Down
25 changes: 2 additions & 23 deletions tests/table/__snapshots__/editor-table-two.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -614,30 +614,9 @@ exports[`EditorProTable 2 📝 renderFormItem run defaultRender 1`] = `
class="ant-form-item-control-input-content"
>
<div
class="ant-form-item"
style="margin-block-start: -5px; margin-block-end: -5px; margin-inline-start: 0; margin-inline-end: 0;"
class="ant-pro-field-index-column ant-pro-field-index-column-border"
>
<div
class="ant-row ant-form-item-row"
>
<div
class="ant-col ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<div
class="ant-pro-field-index-column ant-pro-field-index-column-border"
>
1
</div>
</div>
</div>
</div>
</div>
1
</div>
</div>
</div>
Expand Down

0 comments on commit c3b8ffd

Please sign in to comment.