Skip to content

Commit

Permalink
chore: better safety for defaultExpandedRowKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
tinymins committed Nov 1, 2024
1 parent 1160668 commit c180a72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/drip-table/src/layouts/table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@ function TableLayout<
const subtable = tableProps.schema.subtable;
const rowExpandable = tableProps.rowExpandable;
if (rowExpandColumnVisible) {
const defaultExpandedRowKeys = rowKey && tableProps.defaultExpandedRowKeys
const defaultExpandedRowKeys = rowKey && Array.isArray(tableProps.defaultExpandedRowKeys)
? tableProps.defaultExpandedRowKeys?.map(k => rcTableDataSource.find(v => v.record[rowKey] === k)?.key).filter(Boolean)
: void 0;
return {
Expand Down

0 comments on commit c180a72

Please sign in to comment.