Skip to content

Commit

Permalink
Merge pull request #333 from adibmbrk/fix-22337
Browse files Browse the repository at this point in the history
fix(react): fix `TextField` component to preserve `InputProps`
  • Loading branch information
brionmario authored Feb 7, 2025
2 parents c44593e + 9516c5f commit ed149c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react/src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export type TextFieldProps<C extends ElementType = ElementType> = {

const PasswordField: ForwardRefExoticComponent<TextFieldProps> = forwardRef(
<C extends ElementType = ElementType>(
{type, variant, ...rest}: TextFieldProps<C>,
{type, variant, InputProps, ...rest}: TextFieldProps<C>,
ref: Ref<HTMLDivElement>,
): ReactElement => {
const [showPassword, setShowPassword] = useState(false);
Expand All @@ -72,7 +72,8 @@ const PasswordField: ForwardRefExoticComponent<TextFieldProps> = forwardRef(
ref={ref}
type={showPassword ? 'text' : 'password'}
InputProps={{
endAdornment: (
...(InputProps ?? {}),
endAdornment: InputProps?.endAdornment || (
<InputAdornment position="end">
<IconButton
aria-label="toggle password visibility"
Expand Down

0 comments on commit ed149c9

Please sign in to comment.