diff --git a/frontend-v2/src/components/TextField.tsx b/frontend-v2/src/components/TextField.tsx index 36db383e..9f4f2c68 100644 --- a/frontend-v2/src/components/TextField.tsx +++ b/frontend-v2/src/components/TextField.tsx @@ -16,6 +16,7 @@ type Props = { rules?: Record; mode?: "onChange" | "onBlur"; textFieldProps?: material.TextFieldProps; + autoShrink?: boolean; sx?: material.SxProps }; @@ -26,6 +27,7 @@ function TextField({ rules, mode, textFieldProps, + autoShrink, sx }: Props): React.ReactElement { const [fieldValue, setFieldValue] = useFieldState({ name, control }); @@ -66,6 +68,7 @@ function TextField({ } name={name} id={name} + InputLabelProps={autoShrink !== undefined ? { shrink: autoShrink } : {}} variant="outlined" value={ fieldValue === undefined || fieldValue === null ? "" : fieldValue diff --git a/frontend-v2/src/features/login/login.tsx b/frontend-v2/src/features/login/login.tsx index 37449afd..06edd9af 100644 --- a/frontend-v2/src/features/login/login.tsx +++ b/frontend-v2/src/features/login/login.tsx @@ -47,6 +47,7 @@ const Login: React.FC = ({ onLogin, isLoading, errorMessage }) => { control={control} textFieldProps={{ autoComplete: "username" }} mode="onChange" + autoShrink={true} /> = ({ onLogin, isLoading, errorMessage }) => { control={control} textFieldProps={{ autoComplete: "password", type: "password" }} mode="onChange" + autoShrink={true} />