fix(widget-list): when single field value is object widget (#2387)
* fix list widget field * ignore sub list widget
This commit is contained in:
parent
002cdd77a8
commit
90748ff4fe
@ -245,10 +245,13 @@ export default class ListControl extends React.Component {
|
|||||||
return (fieldName, newValue, newMetadata) => {
|
return (fieldName, newValue, newMetadata) => {
|
||||||
const { value, metadata, onChange, field } = this.props;
|
const { value, metadata, onChange, field } = this.props;
|
||||||
const collectionName = field.get('name');
|
const collectionName = field.get('name');
|
||||||
const newObjectValue =
|
const listFieldObjectWidget = field.getIn(['field', 'widget']) === 'object';
|
||||||
this.getValueType() !== valueTypes.SINGLE
|
const withNameKey =
|
||||||
? this.getObjectValue(index).set(fieldName, newValue)
|
this.getValueType() !== valueTypes.SINGLE ||
|
||||||
: newValue;
|
(this.getValueType() === valueTypes.SINGLE && listFieldObjectWidget);
|
||||||
|
const newObjectValue = withNameKey
|
||||||
|
? this.getObjectValue(index).set(fieldName, newValue)
|
||||||
|
: newValue;
|
||||||
const parsedMetadata = {
|
const parsedMetadata = {
|
||||||
[collectionName]: Object.assign(metadata ? metadata.toJS() : {}, newMetadata || {}),
|
[collectionName]: Object.assign(metadata ? metadata.toJS() : {}, newMetadata || {}),
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user