diff --git a/src/components/inputs/reactHookForm/text/TextInput.tsx b/src/components/inputs/reactHookForm/text/TextInput.tsx index 593a04ae..61ccb5a6 100644 --- a/src/components/inputs/reactHookForm/text/TextInput.tsx +++ b/src/components/inputs/reactHookForm/text/TextInput.tsx @@ -113,7 +113,7 @@ export function TextInput({ {...genHelperPreviousValue(previousValue!, adornment)} {...genHelperError(error?.message)} {...formProps} - {...finalAdornment} + {...(adornment && { ...finalAdornment })} /> ); } diff --git a/src/components/inputs/reactHookForm/utils/TextFieldWithAdornment.tsx b/src/components/inputs/reactHookForm/utils/TextFieldWithAdornment.tsx index 14e6d8a6..0cb7ca7c 100644 --- a/src/components/inputs/reactHookForm/utils/TextFieldWithAdornment.tsx +++ b/src/components/inputs/reactHookForm/utils/TextFieldWithAdornment.tsx @@ -14,8 +14,8 @@ import { Input } from '../../../../utils/types/types'; export type TextFieldWithAdornmentProps = TextFieldProps & { // variant already included in TextFieldProps value: Input; // we override the default type of TextFieldProps which is unknown - adornmentPosition: string; - adornmentText: string; + adornmentPosition?: string; + adornmentText?: string; handleClearValue?: () => void; };