From b4197e54e62158dcdb5294014c455f5c40c653ad Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 22 Jun 2022 21:05:03 +1200 Subject: [PATCH] fix: input fields (PR #1110 from NickMolloy/improve-input-attributes) * Use correct input type "string" is not a valid input type: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types "text" is the actual valid value. * Use correct autocomplete values for credential fields "true", "on", and "confirm-password" are not valid autocomplete values https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete --- frontend/src/component/user/HostedAuth/HostedAuth.tsx | 3 ++- frontend/src/component/user/PasswordAuth/PasswordAuth.tsx | 6 +++--- .../component/user/UserProfile/EditProfile/EditProfile.tsx | 4 ++-- .../user/common/ResetPasswordForm/ResetPasswordForm.tsx | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/component/user/HostedAuth/HostedAuth.tsx b/frontend/src/component/user/HostedAuth/HostedAuth.tsx index 5cbde3d723..ce2745b946 100644 --- a/frontend/src/component/user/HostedAuth/HostedAuth.tsx +++ b/frontend/src/component/user/HostedAuth/HostedAuth.tsx @@ -113,7 +113,7 @@ const HostedAuth: VFC = ({ authDetails, redirect }) => { label="Username or email" name="username" id="username" - type="string" + type="text" onChange={evt => setUsername(evt.target.value)} value={username} error={Boolean(usernameError)} @@ -130,6 +130,7 @@ const HostedAuth: VFC = ({ authDetails, redirect }) => { value={password} error={Boolean(passwordError)} helperText={passwordError} + autoComplete="current-password" data-testid={LOGIN_PASSWORD_ID} /> diff --git a/frontend/src/component/user/PasswordAuth/PasswordAuth.tsx b/frontend/src/component/user/PasswordAuth/PasswordAuth.tsx index 51c54029d6..d25e10dfc1 100644 --- a/frontend/src/component/user/PasswordAuth/PasswordAuth.tsx +++ b/frontend/src/component/user/PasswordAuth/PasswordAuth.tsx @@ -117,12 +117,12 @@ const PasswordAuth: VFC = ({ authDetails, redirect }) => { label="Username or email" name="username" id="username" - type="string" + type="text" onChange={evt => setUsername(evt.target.value)} value={username} error={Boolean(usernameError)} helperText={usernameError} - autoComplete="true" + autoComplete="username" data-testid={LOGIN_EMAIL_ID} variant="outlined" size="small" @@ -136,7 +136,7 @@ const PasswordAuth: VFC = ({ authDetails, redirect }) => { value={password} error={Boolean(passwordError)} helperText={passwordError} - autoComplete="true" + autoComplete="current-password" data-testid={LOGIN_PASSWORD_ID} />