From 9516c5fa0c18e2c8da9c011e6090126949dec4a5 Mon Sep 17 00:00:00 2001 From: Brion Mario Date: Fri, 7 Feb 2025 14:14:02 +0530 Subject: [PATCH] chore: refactor input props in `PasswordField` --- packages/react/src/components/TextField/TextField.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react/src/components/TextField/TextField.tsx b/packages/react/src/components/TextField/TextField.tsx index 79d9de86..a30bfff3 100644 --- a/packages/react/src/components/TextField/TextField.tsx +++ b/packages/react/src/components/TextField/TextField.tsx @@ -56,7 +56,7 @@ export type TextFieldProps = { const PasswordField: ForwardRefExoticComponent = forwardRef( ( - {type, variant, InputProps = {}, ...rest}: TextFieldProps, + {type, variant, InputProps, ...rest}: TextFieldProps, ref: Ref, ): ReactElement => { const [showPassword, setShowPassword] = useState(false); @@ -72,8 +72,8 @@ const PasswordField: ForwardRefExoticComponent = forwardRef( ref={ref} type={showPassword ? 'text' : 'password'} InputProps={{ - ...InputProps, - endAdornment: InputProps.endAdornment || ( + ...(InputProps ?? {}), + endAdornment: InputProps?.endAdornment || (