diff --git a/src/components/inputs/TextField/TextField.tsx b/src/components/inputs/TextField/TextField.tsx index 5c85d593..07f574aa 100644 --- a/src/components/inputs/TextField/TextField.tsx +++ b/src/components/inputs/TextField/TextField.tsx @@ -148,7 +148,6 @@ const TextField: React.FC = ({ minValue = -Infinity, maxValue = Infinity, variant = 'standard', - helperText, ...rest }) => { const isNumeric = receivedIsNumeric || isStepper @@ -264,7 +263,6 @@ const TextField: React.FC = ({ className: classes.label, ...InputLabelProps }} - helperText={helperText || ' '} /> ) } @@ -370,11 +368,7 @@ TextField.propTypes = { * @default 'standard' * The variant to use. */ - variant: PropTypes.oneOf(['filled', 'standard', 'outlined']), - /** - * Provide feedback to the user about the error. - */ - helperText: PropTypes.string + variant: PropTypes.oneOf(['filled', 'standard', 'outlined']) } export default TextField diff --git a/src/components/themes/common/overrides/TextField.ts b/src/components/themes/common/overrides/TextField.ts new file mode 100644 index 00000000..a51750cc --- /dev/null +++ b/src/components/themes/common/overrides/TextField.ts @@ -0,0 +1,16 @@ +import { CustomComponents } from '../../types' + +export default function TextField(): CustomComponents { + return { + MuiFormHelperText: { + styleOverrides: { + root: { + '&.Mui-error': { + marginTop: 0, + lineHeight: 1 + } + } + } + } + } +} diff --git a/src/components/themes/common/overrides/index.ts b/src/components/themes/common/overrides/index.ts index 9b6b0f9d..c57db621 100644 --- a/src/components/themes/common/overrides/index.ts +++ b/src/components/themes/common/overrides/index.ts @@ -1,12 +1,14 @@ import Card from './Card' import Button from './Button' import Divider from './Divider' +import TextField from './TextField' import { Theme } from '@mui/material' import { CustomComponents } from '../../types' const componentsOverride = (theme: Theme): CustomComponents => ({ ...Card(theme), ...Button(theme), - ...Divider() + ...Divider(), + ...TextField() }) export default componentsOverride