From 1791ccae91d98d779ce7c2305f681b230cd1c622 Mon Sep 17 00:00:00 2001 From: AegeanSeaBlue <1757793899@qq.com> Date: Tue, 28 Sep 2021 18:15:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20crud=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96?= =?UTF-8?q?value=E7=9A=84=E4=BF=AE=E5=A4=8D=20(#2627)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: AegeanSeaBlue <2285105697@qq.com> --- src/renderers/CRUD.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/renderers/CRUD.tsx b/src/renderers/CRUD.tsx index 9cf00326f..c9df48ceb 100644 --- a/src/renderers/CRUD.tsx +++ b/src/renderers/CRUD.tsx @@ -18,6 +18,7 @@ import { isObjectShallowModified, noop, isVisible, + getPropValue, getVariable, qsstringify, qsparse @@ -476,8 +477,9 @@ export default class CRUD extends React.Component { this.handleFilterInit({}); } - if (this.props.pickerMode && this.props.value) { - store.setSelectedItems(this.props.value); + const val = getPropValue(this.props); + if (this.props.pickerMode && val) { + store.setSelectedItems(val); } } @@ -497,8 +499,9 @@ export default class CRUD extends React.Component { this.renderFooterToolbar = this.renderFooterToolbar.bind(this); } - if (this.props.pickerMode && this.props.value !== prevProps.value) { - store.setSelectedItems(props.value); + const val = getPropValue(this.props); + if (this.props.pickerMode && val !== getPropValue(prevProps)) { + store.setSelectedItems(val); } if (this.props.filterTogglable !== prevProps.filterTogglable) {