Skip to content

Commit b0168f1

Browse files
authored
Merge pull request processing#3176 from shujuuu/fix-login-signup-fields-width
fix signup & login input width
2 parents ce21388 + 187ffd8 commit b0168f1

File tree

3 files changed

+72
-62
lines changed

3 files changed

+72
-62
lines changed

client/modules/User/components/LoginForm.jsx

+21-19
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,27 @@ function LoginForm() {
5555
<label htmlFor="password" className="form__label">
5656
{t('LoginForm.Password')}
5757
</label>
58-
<button
59-
className="form__eye__icon"
60-
type="button"
61-
onClick={handleVisibility}
62-
>
63-
{showPassword ? (
64-
<AiOutlineEyeInvisible />
65-
) : (
66-
<AiOutlineEye />
67-
)}
68-
</button>
69-
<input
70-
className="form__input"
71-
aria-label={t('LoginForm.PasswordARIA')}
72-
type={showPassword ? 'text' : 'password'}
73-
id="password"
74-
autoComplete="current-password"
75-
{...field.input}
76-
/>
58+
<div className="form__field__password">
59+
<button
60+
className="form__eye__icon"
61+
type="button"
62+
onClick={handleVisibility}
63+
>
64+
{showPassword ? (
65+
<AiOutlineEyeInvisible />
66+
) : (
67+
<AiOutlineEye />
68+
)}
69+
</button>
70+
<input
71+
className="form__input"
72+
aria-label={t('LoginForm.PasswordARIA')}
73+
type={showPassword ? 'text' : 'password'}
74+
id="password"
75+
autoComplete="current-password"
76+
{...field.input}
77+
/>
78+
</div>
7779
{field.meta.touched && field.meta.error && (
7880
<span className="form-error">{field.meta.error}</span>
7981
)}

client/modules/User/components/SignupForm.jsx

+42-38
Original file line numberDiff line numberDiff line change
@@ -109,25 +109,27 @@ function SignupForm() {
109109
<label htmlFor="password" className="form__label">
110110
{t('SignupForm.Password')}
111111
</label>
112-
<button
113-
className="form__eye__icon"
114-
type="button"
115-
onClick={handleVisibility}
116-
>
117-
{showPassword ? (
118-
<AiOutlineEyeInvisible />
119-
) : (
120-
<AiOutlineEye />
121-
)}
122-
</button>
123-
<input
124-
className="form__input"
125-
aria-label={t('SignupForm.PasswordARIA')}
126-
type={showPassword ? 'text' : 'password'}
127-
id="password"
128-
autoComplete="new-password"
129-
{...field.input}
130-
/>
112+
<div className="form__field__password">
113+
<button
114+
className="form__eye__icon"
115+
type="button"
116+
onClick={handleVisibility}
117+
>
118+
{showPassword ? (
119+
<AiOutlineEyeInvisible />
120+
) : (
121+
<AiOutlineEye />
122+
)}
123+
</button>
124+
<input
125+
className="form__input"
126+
aria-label={t('SignupForm.PasswordARIA')}
127+
type={showPassword ? 'text' : 'password'}
128+
id="password"
129+
autoComplete="new-password"
130+
{...field.input}
131+
/>
132+
</div>
131133
{field.meta.touched && field.meta.error && (
132134
<span className="form-error">{field.meta.error}</span>
133135
)}
@@ -142,25 +144,27 @@ function SignupForm() {
142144
<label htmlFor="confirmPassword" className="form__label">
143145
{t('SignupForm.ConfirmPassword')}
144146
</label>
145-
<button
146-
className="form__eye__icon"
147-
type="button"
148-
onClick={handleConfirmVisibility}
149-
>
150-
{showConfirmPassword ? (
151-
<AiOutlineEyeInvisible />
152-
) : (
153-
<AiOutlineEye />
154-
)}
155-
</button>
156-
<input
157-
className="form__input"
158-
type={showConfirmPassword ? 'text' : 'password'}
159-
aria-label={t('SignupForm.ConfirmPasswordARIA')}
160-
id="confirmPassword" // Match the id with htmlFor
161-
autoComplete="new-password"
162-
{...field.input}
163-
/>
147+
<div className="form__field__password">
148+
<button
149+
className="form__eye__icon"
150+
type="button"
151+
onClick={handleConfirmVisibility}
152+
>
153+
{showConfirmPassword ? (
154+
<AiOutlineEyeInvisible />
155+
) : (
156+
<AiOutlineEye />
157+
)}
158+
</button>
159+
<input
160+
className="form__input"
161+
type={showConfirmPassword ? 'text' : 'password'}
162+
aria-label={t('SignupForm.ConfirmPasswordARIA')}
163+
id="confirmPassword" // Match the id with htmlFor
164+
autoComplete="new-password"
165+
{...field.input}
166+
/>
167+
</div>
164168
{field.meta.touched && field.meta.error && (
165169
<span className="form-error">{field.meta.error}</span>
166170
)}

client/styles/components/_forms.scss

+9-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
}
5959

6060
.form__input {
61-
min-width: #{math.div(355, $base-font-size)}rem;
61+
min-width: #{math.div(312, $base-font-size)}rem;
6262
width: 100%;
6363
height: #{math.div(40, $base-font-size)}rem;
6464
font-size: #{math.div(16, $base-font-size)}rem;
@@ -73,12 +73,16 @@
7373
}
7474
}
7575

76+
.form__field__password {
77+
position: relative;
78+
}
79+
7680
.form__eye__icon {
7781
font-size: 28px;
78-
position: relative;
79-
top: 7px;
80-
right: -355px;
81-
margin-left: -40px;
82+
position: absolute;
83+
right: 0px;
84+
top: 4px;
85+
vertical-align: middle;
8286
}
8387

8488

0 commit comments

Comments
 (0)