remove icon label from text input (#21025)

This commit is contained in:
Erik Jan de Wit 2023-06-19 08:35:56 +02:00 committed by GitHub
parent 73daf8b540
commit 310aa43f16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,7 @@ export const TextControl = <
>( >(
props: TextControlProps<T, P> props: TextControlProps<T, P>
) => { ) => {
const { labelIcon, ...rest } = props;
const required = !!props.rules?.required; const required = !!props.rules?.required;
const defaultValue = props.defaultValue ?? ("" as PathValue<T, P>); const defaultValue = props.defaultValue ?? ("" as PathValue<T, P>);
@ -38,7 +39,7 @@ export const TextControl = <
<FormLabel <FormLabel
name={props.name} name={props.name}
label={props.label} label={props.label}
labelIcon={props.labelIcon} labelIcon={labelIcon}
isRequired={required} isRequired={required}
error={fieldState.error} error={fieldState.error}
> >
@ -50,7 +51,7 @@ export const TextControl = <
fieldState.error ? ValidatedOptions.error : ValidatedOptions.default fieldState.error ? ValidatedOptions.error : ValidatedOptions.default
} }
isDisabled={props.isDisabled} isDisabled={props.isDisabled}
{...props} {...rest}
{...field} {...field}
/> />
</FormLabel> </FormLabel>