Skip to content

Commit

Permalink
fix(core): fix antd table get row key (#946)
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang authored Jul 4, 2020
1 parent 6ac8312 commit 6bda329
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/antd-components/src/array-table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,12 @@ export const ArrayTable: any = styled(
})
}
const renderTable = () => {
let index = 0
return (
<Table
{...componentProps}
rowKey={() => index++}
rowKey={record => {
return toArr(value).indexOf(record)
}}
pagination={false}
columns={columns}
dataSource={toArr(value)}
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/models/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,9 @@ export const Field = createModel<IFieldState, IFieldStateProps>(
draft.value = undefined
draft.values = toArr(draft.values)
draft.values[0] = undefined
this.updates.push('value')
} else if (draft.visible === true) {
if (!isValid(draft.value)) {
draft.value = draft.visibleCacheValue
this.updates.push('value')
}
}
}
Expand Down

0 comments on commit 6bda329

Please sign in to comment.