File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed
client/packages/lowcoder/src/comps/comps/formComp Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -390,15 +390,24 @@ let FormTmpComp = class extends FormBaseComp implements IForm {
390
390
if ( ret . children . initialData !== this . children . initialData ) {
391
391
// FIXME: kill setTimeout ?
392
392
setTimeout ( ( ) => {
393
- this . dispatch (
394
- customAction < SetDataAction > (
395
- {
396
- type : "setData" ,
397
- initialData : ( action . value [ "initialData" ] as ValueAndMsg < JSONObject > ) . value || { } ,
398
- } ,
399
- false
400
- )
401
- ) ;
393
+ const newInitialData = ( action . value [ "initialData" ] as ValueAndMsg < JSONObject > )
394
+ . value ;
395
+ // only setData when initialData has explicit keys.
396
+ if (
397
+ newInitialData &&
398
+ typeof newInitialData === "object" &&
399
+ Object . keys ( newInitialData ) . length > 0
400
+ ) {
401
+ this . dispatch (
402
+ customAction < SetDataAction > (
403
+ {
404
+ type : "setData" ,
405
+ initialData : newInitialData ,
406
+ } ,
407
+ false
408
+ )
409
+ ) ;
410
+ }
402
411
} , 1000 ) ;
403
412
}
404
413
return ret ;
You can’t perform that action at this time.
0 commit comments