Merge pull request #929 from Britaliope/fix-enum-fields

(v2) fix: "Enum" fields (drowdown and radio) does not render correctly
This commit is contained in:
Tomas Bures 2020-08-28 08:22:32 +02:00 committed by GitHub
commit 5a42756b12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,8 +188,8 @@ fieldTypes['radio-enum'] = {
cardinality: Cardinality.SINGLE,
getHbsType: field => 'typeRadioEnum',
render: (field, value) => {
const fld = field.settings.options[value];
return fld ? fld.name : '';
const fld = field.settings.options.find(x => x.key === value);
return fld ? fld.label : '';
}
};
@ -205,8 +205,8 @@ fieldTypes['dropdown-enum'] = {
cardinality: Cardinality.SINGLE,
getHbsType: field => 'typeDropdownEnum',
render: (field, value) => {
const fld = field.settings.options[value];
return fld ? fld.name : '';
const fld = field.settings.options.find(x => x.key === value);
return fld ? fld.label : '';
}
};