[WEB-2211] fix: input autoComplete (#5333)

* fix: input autoComplete

* chore: code refactor

* chore: set autoComplete on for email, password and name
This commit is contained in:
Anmol Singh Bhatia 2024-08-09 16:42:31 +05:30 committed by GitHub
parent 0b72bd373b
commit 24b1e71cbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 36 additions and 1 deletions

View file

@ -7,10 +7,21 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
inputSize?: "sm" | "md";
hasError?: boolean;
className?: string;
autoComplete?: "on" | "off";
}
const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref) => {
const { id, type, name, mode = "primary", inputSize = "sm", hasError = false, className = "", ...rest } = props;
const {
id,
type,
name,
mode = "primary",
inputSize = "sm",
hasError = false,
className = "",
autoComplete = "off",
...rest
} = props;
return (
<input
@ -31,6 +42,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref) => {
},
className
)}
autoComplete={autoComplete}
{...rest}
/>
);