diff --git a/src/pages/dataElements/form/CustomAttributes.tsx b/src/pages/dataElements/form/CustomAttributes.tsx index ce0b0326..fb67856a 100644 --- a/src/pages/dataElements/form/CustomAttributes.tsx +++ b/src/pages/dataElements/form/CustomAttributes.tsx @@ -1,3 +1,4 @@ +import i18n from '@dhis2/d2-i18n' import { InputFieldFF, SingleSelectFieldFF, TextAreaFieldFF } from '@dhis2/ui' import * as React from 'react' import { Field as FieldRFF } from 'react-final-form' @@ -15,13 +16,18 @@ function CustomAttribute({ attribute, index }: CustomAttributeProps) { const name = `attributeValues[${index}].value` if (attribute.optionSet?.options) { - const options = attribute.optionSet?.options.map( + const attributeOptions = attribute.optionSet?.options.map( ({ code, displayName }) => ({ value: code, label: displayName, }) ) + const options = [ + { value: '', label: i18n.t('') }, + ...(attributeOptions || []), + ] + return (