add disabled and required to User Profile fields (#19976)

This commit is contained in:
Erik Jan de Wit 2023-05-15 17:28:18 +02:00 committed by GitHub
parent b64260bce5
commit 5c8c46c7a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,7 +80,10 @@ export const FormField = ({ attribute }: FormFieldProps) => {
) : ( ) : (
<KeycloakTextInput <KeycloakTextInput
id={attribute.name} id={attribute.name}
{...register(fieldName(attribute.name))} isDisabled={attribute.readOnly}
{...register(fieldName(attribute.name), {
required: { value: attribute.required, message: t("required") },
})}
/> />
)} )}
</FormGroup> </FormGroup>