Skip to content

Commit 44d967d

Browse files
authored
Merge pull request #3215 from RandomGamingDev/develop
Tab based Keyboard navigation now navigates to password input first
2 parents 2b9cb0a + 71a41fc commit 44d967d

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

client/modules/User/components/LoginForm.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ function LoginForm() {
5757
{t('LoginForm.Password')}
5858
</label>
5959
<div className="form__field__password">
60+
<input
61+
className="form__input"
62+
aria-label={t('LoginForm.PasswordARIA')}
63+
type={showPassword ? 'text' : 'password'}
64+
id="password"
65+
autoComplete="current-password"
66+
{...field.input}
67+
/>
6068
<button
6169
className="form__eye__icon"
6270
type="button"
@@ -69,14 +77,6 @@ function LoginForm() {
6977
<AiOutlineEye />
7078
)}
7179
</button>
72-
<input
73-
className="form__input"
74-
aria-label={t('LoginForm.PasswordARIA')}
75-
type={showPassword ? 'text' : 'password'}
76-
id="password"
77-
autoComplete="current-password"
78-
{...field.input}
79-
/>
8080
</div>
8181
{field.meta.touched && field.meta.error && (
8282
<span className="form-error" aria-live="polite">

client/modules/User/components/SignupForm.jsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ function SignupForm() {
113113
{t('SignupForm.Password')}
114114
</label>
115115
<div className="form__field__password">
116+
<input
117+
className="form__input"
118+
aria-label={t('SignupForm.PasswordARIA')}
119+
type={showPassword ? 'text' : 'password'}
120+
id="password"
121+
autoComplete="new-password"
122+
{...field.input}
123+
/>
116124
<button
117125
className="form__eye__icon"
118126
type="button"
@@ -125,14 +133,6 @@ function SignupForm() {
125133
<AiOutlineEye />
126134
)}
127135
</button>
128-
<input
129-
className="form__input"
130-
aria-label={t('SignupForm.PasswordARIA')}
131-
type={showPassword ? 'text' : 'password'}
132-
id="password"
133-
autoComplete="new-password"
134-
{...field.input}
135-
/>
136136
</div>
137137
{field.meta.touched && field.meta.error && (
138138
<span className="form-error" aria-live="polite">
@@ -149,6 +149,14 @@ function SignupForm() {
149149
{t('SignupForm.ConfirmPassword')}
150150
</label>
151151
<div className="form__field__password">
152+
<input
153+
className="form__input"
154+
type={showConfirmPassword ? 'text' : 'password'}
155+
aria-label={t('SignupForm.ConfirmPasswordARIA')}
156+
id="confirmPassword" // Match the id with htmlFor
157+
autoComplete="new-password"
158+
{...field.input}
159+
/>
152160
<button
153161
className="form__eye__icon"
154162
type="button"
@@ -161,14 +169,6 @@ function SignupForm() {
161169
<AiOutlineEye />
162170
)}
163171
</button>
164-
<input
165-
className="form__input"
166-
type={showConfirmPassword ? 'text' : 'password'}
167-
aria-label={t('SignupForm.ConfirmPasswordARIA')}
168-
id="confirmPassword" // Match the id with htmlFor
169-
autoComplete="new-password"
170-
{...field.input}
171-
/>
172172
</div>
173173
{field.meta.touched && field.meta.error && (
174174
<span className="form-error" aria-live="polite">

0 commit comments

Comments
 (0)