fix(RecordPicker): avoid error
This commit is contained in:
parent
5c29262c95
commit
9be1f7ac61
@ -47,7 +47,7 @@ const useTableSelectorProps = () => {
|
||||
rowSelection: {
|
||||
type: multiple ? 'checkbox' : 'radio',
|
||||
selectedRowKeys: rcSelectRows
|
||||
.filter((item) => options.every((row) => row[rowKey] !== item[rowKey]))
|
||||
?.filter((item) => options.every((row) => row[rowKey] !== item[rowKey]))
|
||||
.map((item) => item[rowKey]),
|
||||
},
|
||||
onRowSelectionChange(selectedRowKeys, selectedRows) {
|
||||
@ -187,6 +187,7 @@ export const InputRecordPicker: React.FC<any> = (props: IRecordPickerProps) => {
|
||||
const value = multiple ? [] : null;
|
||||
onChange(value);
|
||||
setSelectedRows(value);
|
||||
setOptions([]);
|
||||
} else if (Array.isArray(changed)) {
|
||||
if (!changed.length) {
|
||||
onChange([]);
|
||||
|
Loading…
Reference in New Issue
Block a user