Skip to content

Commit

Permalink
fix(table): fix editableFormRef no work error
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jun 16, 2023
1 parent 5bb5be1 commit 0cd2e4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/table/src/components/EditableTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function EditableTable<
},
} as EditableFormInstance<DataType>;
},
[props.name],
[props.name, formRef.current],
);

useEffect(() => {
Expand Down
2 changes: 2 additions & 0 deletions tests/table/editor-table-two.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,8 @@ describe('EditorProTable 2', () => {
await waitFor(() => {
return wrapper.findByDisplayValue('动态设置的title' + i);
});

expect(formRef.current?.getFieldValue('table').length).toEqual(2);
});

it('📝 EditableProTable ensures that xxxProps are functions also executed', async () => {
Expand Down

0 comments on commit 0cd2e4d

Please sign in to comment.