Autocomplete style fix and input type fixed for signup and login

This commit is contained in:
Lucas Oliveira 2023-08-30 11:42:58 -03:00
commit 3c9a6af4cd
4 changed files with 24 additions and 2 deletions

View file

@ -30,6 +30,7 @@ export default function InputComponent({
{isForm ? ( {isForm ? (
<Form.Control asChild> <Form.Control asChild>
<Input <Input
type={password && !pwdVisible ? "password" : "text"}
value={value} value={value}
disabled={disabled} disabled={disabled}
required={required} required={required}
@ -53,6 +54,7 @@ export default function InputComponent({
</Form.Control> </Form.Control>
) : ( ) : (
<Input <Input
type={password && !pwdVisible ? "password" : "text"}
value={value} value={value}
disabled={disabled} disabled={disabled}
required={required} required={required}
@ -76,6 +78,8 @@ export default function InputComponent({
)} )}
{password && ( {password && (
<button <button
type="button"
tabIndex={-1}
className={classNames( className={classNames(
editNode editNode
? "input-component-true-button" ? "input-component-true-button"

View file

@ -89,6 +89,7 @@ export default function LoginPage(): JSX.Element {
<Form.Control asChild> <Form.Control asChild>
<Input <Input
type="username"
onChange={({ target: { value } }) => { onChange={({ target: { value } }) => {
handleInput({ target: { name: "username", value } }); handleInput({ target: { name: "username", value } });
}} }}
@ -129,12 +130,12 @@ export default function LoginPage(): JSX.Element {
</div> </div>
<div className="w-full"> <div className="w-full">
<Form.Submit asChild> <Form.Submit asChild>
<Button className="mr-3 mt-6 w-full">Sign in</Button> <Button className="mr-3 mt-6 w-full" type="submit">Sign in</Button>
</Form.Submit> </Form.Submit>
</div> </div>
<div className="w-full"> <div className="w-full">
<Link to="/signup"> <Link to="/signup">
<Button className="w-full" variant="outline"> <Button className="w-full" variant="outline" type="button">
Don't have an account?&nbsp;<b>Sign Up</b> Don't have an account?&nbsp;<b>Sign Up</b>
</Button> </Button>
</Link> </Link>

View file

@ -84,6 +84,7 @@ export default function SignUp(): JSX.Element {
<Form.Control asChild> <Form.Control asChild>
<Input <Input
type="username"
onChange={({ target: { value } }) => { onChange={({ target: { value } }) => {
handleInput({ target: { name: "username", value } }); handleInput({ target: { name: "username", value } });
}} }}
@ -157,6 +158,7 @@ export default function SignUp(): JSX.Element {
<div className="w-full"> <div className="w-full">
<Form.Submit asChild> <Form.Submit asChild>
<Button <Button
type="submit"
className="mr-3 mt-6 w-full" className="mr-3 mt-6 w-full"
onClick={() => { onClick={() => {
handleSignup(); handleSignup();

View file

@ -36,3 +36,18 @@ pre {
.gradient-start { .gradient-start {
animation: gradient-motion-start 4s infinite forwards; animation: gradient-motion-start 4s infinite forwards;
} }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
-webkit-text-fill-color: black;
-webkit-box-shadow: 0 0 0px 1000px #fff6d0 inset;
box-shadow: 0 0 0px 1000px #fff6d0 inset;
color: black;
}