Skip to content

Commit

Permalink
chore: refactor input props in PasswordField
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario authored Feb 7, 2025
1 parent 72aba9d commit 9516c5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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, InputProps = {}, ...rest}: TextFieldProps<C>,
{type, variant, InputProps, ...rest}: TextFieldProps<C>,
ref: Ref<HTMLDivElement>,
): ReactElement => {
const [showPassword, setShowPassword] = useState(false);
Expand All @@ -72,8 +72,8 @@ const PasswordField: ForwardRefExoticComponent<TextFieldProps> = forwardRef(
ref={ref}
type={showPassword ? 'text' : 'password'}
InputProps={{
...InputProps,
endAdornment: InputProps.endAdornment || (
...(InputProps ?? {}),
endAdornment: InputProps?.endAdornment || (
<InputAdornment position="end">
<IconButton
aria-label="toggle password visibility"
Expand Down

0 comments on commit 9516c5f

Please sign in to comment.