Skip to content

Commit

Permalink
fix(react): remove MuiOutlinedInput unwanted padding override
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario committed Oct 22, 2024
1 parent 4106661 commit 04699e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
14 changes: 11 additions & 3 deletions packages/react/src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const PasswordFieldWithCriteria: ForwardRefExoticComponent<TextFieldProps> = for
*/
const TextField: OverridableComponent<FormControlTypeMap<TextFieldProps>> = forwardRef(
<C extends ElementType = ElementType>(
{className, id, label, type, InputLabelProps, variant, ...rest}: TextFieldProps<C>,
{className, id, label, type, InputLabelProps, variant, size = 'small', ...rest}: TextFieldProps<C>,
ref: Ref<HTMLDivElement>,
): ReactElement => {
const classes: string = clsx('oxygen-text-field', className);
Expand All @@ -186,9 +186,17 @@ const TextField: OverridableComponent<FormControlTypeMap<TextFieldProps>> = forw
{label}
</InputLabel>
{type === TextFieldInputTypes.INPUT_PASSWORD ? (
<PasswordFieldWithCriteria ref={ref} id={id} variant={variant} type={type} {...rest} />
<PasswordFieldWithCriteria ref={ref} id={id} variant={variant} type={type} size={size} {...rest} />
) : (
<MuiTextField ref={ref} id={id} variant={variant} className="OxygenTextField-root" type={type} {...rest} />
<MuiTextField
ref={ref}
id={id}
variant={variant}
className="OxygenTextField-root"
type={type}
size={size}
{...rest}
/>
)}
</div>
);
Expand Down
7 changes: 0 additions & 7 deletions packages/react/src/theme/default-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,6 @@ export const generateDefaultThemeOptions = (baseTheme: Theme): RecursivePartial<
},
},
},
MuiOutlinedInput: {
styleOverrides: {
input: {
padding: '0.67857143em 1em',
},
},
},
MuiTypography: {
defaultProps: {
variantMapping: {
Expand Down

0 comments on commit 04699e4

Please sign in to comment.