fix: crud兼容cards使用场景 (#7841)

Co-authored-by: wanglinfang <wanglinfang@baidu.com>
This commit is contained in:
wanglinfang2014 2023-08-16 17:42:45 +08:00 committed by GitHub
parent d66030bb1f
commit 2d65369964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -562,7 +562,6 @@ exports[`Renderer:input table add 1`] = `
>
<table
class="cxd-Table-table"
style="table-layout: fixed;"
>
<colgroup>
<col

View File

@ -585,14 +585,15 @@ export default class CRUD extends React.Component<CRUDProps, any> {
// 显隐切换时,也会导致需要二次点击才能选中的问题
let val: any;
const valueField = props.valueField || props.primaryField;
if (
this.props.pickerMode &&
isArrayChildrenModified(
(val = getPropValue(this.props)).map((item: any) => item[valueField]),
getPropValue(prevProps).map((item: any) => item[valueField])
(val = getPropValue(this.props))?.map((item: any) => item[valueField]),
getPropValue(prevProps)?.map((item: any) => item[valueField])
) &&
!isEqual(
val.map((item: any) => item[valueField]),
val?.map((item: any) => item[valueField]),
store.selectedItems.concat().map((item: any) => item[valueField])
)
) {