Skip to content

Commit

Permalink
fix(react): fix margin issues in TextField
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario committed Oct 23, 2024
1 parent 046963d commit 0eaa265
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions packages/react/src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,17 @@ const PasswordFieldWithCriteria: ForwardRefExoticComponent<TextFieldProps> = for
*/
const TextField: OverridableComponent<FormControlTypeMap<TextFieldProps>> = forwardRef(
<C extends ElementType = ElementType>(
{className, id, label, type, InputLabelProps, variant, size = 'small', ...rest}: TextFieldProps<C>,
{
className,
id,
label,
type,
InputLabelProps,
variant,
size = 'small',
margin = 'dense',
...rest
}: TextFieldProps<C>,
ref: Ref<HTMLDivElement>,
): ReactElement => {
const classes: string = clsx('oxygen-text-field', className);
Expand All @@ -186,7 +196,15 @@ const TextField: OverridableComponent<FormControlTypeMap<TextFieldProps>> = forw
{label}
</InputLabel>
{type === TextFieldInputTypes.INPUT_PASSWORD ? (
<PasswordFieldWithCriteria ref={ref} id={id} variant={variant} type={type} size={size} {...rest} />
<PasswordFieldWithCriteria
ref={ref}
id={id}
variant={variant}
type={type}
size={size}
margin={margin}
{...rest}
/>
) : (
<MuiTextField
ref={ref}
Expand All @@ -195,6 +213,7 @@ const TextField: OverridableComponent<FormControlTypeMap<TextFieldProps>> = forw
className="OxygenTextField-root"
type={type}
size={size}
margin={margin}
{...rest}
/>
)}
Expand Down

0 comments on commit 0eaa265

Please sign in to comment.