diff --git a/src/components/form/fields/DescriptionField.tsx b/src/components/form/fields/DescriptionField.tsx index 629ad075..40c695f5 100644 --- a/src/components/form/fields/DescriptionField.tsx +++ b/src/components/form/fields/DescriptionField.tsx @@ -1,5 +1,5 @@ import i18n from '@dhis2/d2-i18n' -import { TextAreaFieldFF } from '@dhis2/ui' +import { createMaxCharacterLength, TextAreaFieldFF } from '@dhis2/ui' import React from 'react' import { Field as FieldRFF } from 'react-final-form' import { SchemaSection, useCheckMaxLengthFromSchema } from '../../../lib' @@ -11,10 +11,7 @@ export function DescriptionField({ helpText?: string schemaSection: SchemaSection }) { - const validate = useCheckMaxLengthFromSchema( - schemaSection.name, - 'description' - ) + const validate = createMaxCharacterLength(2000) return (