Fix lookup and color field formatters (#84994)

* fix lookup field formatter

* fix color formatter
This commit is contained in:
Matthew Kime 2020-12-04 09:46:42 -06:00 committed by GitHub
parent 71f863ef66
commit e7d8dd48f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -63,7 +63,7 @@ export class ColorFormatEditor extends DefaultFormatEditor<ColorFormatEditorForm
};
addColor = () => {
const colors = [...this.props.formatParams.colors];
const colors = [...(this.props.formatParams.colors || [])];
this.onChange({
colors: [...colors, { ...fieldFormats.DEFAULT_CONVERTER_COLOR }],
});

View file

@ -50,7 +50,7 @@ export class StaticLookupFormatEditor extends DefaultFormatEditor<StaticLookupFo
};
addLookup = () => {
const lookupEntries = [...this.props.formatParams.lookupEntries];
const lookupEntries = [...(this.props.formatParams.lookupEntries || [])];
this.onChange({
lookupEntries: [...lookupEntries, {}],
});