Skip to content

Commit c487394

Browse files
authored
Merge pull request #17 from shayaan-khan-astero/main
Add autocomplete attributes for improved form accessibility + other changes
2 parents 409a8cc + 595ba98 commit c487394

40 files changed

Lines changed: 139 additions & 79 deletions

src/html/pages/authentication/basic/2-step-verification-code.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ import ThemeToggler from '../../../components/common/theme-toggler.astro'
7575
/>
7676
</div>
7777
<div class="form-check text-start mb-3">
78-
<input class="form-check-input" type="checkbox" id="dontAskAgain" />
7978
<label class="form-check-label" for="dontAskAgain">
79+
<input class="form-check-input" type="checkbox" id="dontAskAgain" />
8080
Do not ask again on this device
8181
</label>
8282
</div>

src/html/pages/authentication/basic/2-step-verification.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import ThemeToggler from '../../../components/common/theme-toggler.astro'
4747
id="phone"
4848
placeholder="Enter your phone number"
4949
pattern="[0-9]{10}"
50+
autocomplete="tel"
5051
required
5152
/>
5253
</div>

src/html/pages/authentication/basic/forgot-password.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { getPathPrefix } from '../../../../utils/path.js'
3535
class="form-control"
3636
id="email"
3737
placeholder="m@example.com"
38+
autocomplete="username"
3839
required
3940
/>
4041
</div>

src/html/pages/authentication/basic/lock-screen.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ import { getPathPrefix, getAssetPrefix } from '../../../../utils/path.js'
5656
class="form-control password-input"
5757
id="password"
5858
placeholder="Enter your password"
59+
autocomplete="current-password"
5960
required
6061
/>
61-
<button class="password-toggle" type="button">
62+
<button class="password-toggle" type="button" aria-label="Show password">
6263
<i class="ri-eye-off-line"></i>
6364
</button>
6465
</div>

src/html/pages/authentication/basic/login.astro

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { getPathPrefix } from '../../../../utils/path.js'
2929
class="form-control"
3030
id="email"
3131
placeholder="m@example.com"
32+
autocomplete="username"
3233
required
3334
/>
3435
</div>
@@ -45,17 +46,19 @@ import { getPathPrefix } from '../../../../utils/path.js'
4546
type="password"
4647
class="form-control password-input"
4748
id="password"
48-
placeholder="Enter your password"
49+
placeholder="Password"
50+
autocomplete="current-password"
4951
required
5052
/>
51-
<button class="password-toggle" type="button">
53+
<button class="password-toggle" type="button" aria-label="Show password">
5254
<i class="ri-eye-off-line"></i>
5355
</button>
5456
</div>
5557
</div>
5658
<div class="mb-3 form-check">
57-
<input type="checkbox" class="form-check-input" id="rememberMe" />
58-
<label class="form-check-label" for="rememberMe"> Remember me </label>
59+
<label class="form-check-label" for="rememberMe">
60+
<input type="checkbox" class="form-check-input" id="rememberMe" /> Remember me
61+
</label>
5962
</div>
6063
<button type="submit" class="btn btn-primary w-100 mb-3">Login</button>
6164
</form>

src/html/pages/authentication/basic/new-password.astro

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ import { getPathPrefix } from '../../../../utils/path.js'
3636
type="password"
3737
class="form-control password-input"
3838
id="new-password"
39-
placeholder="Create a new password"
39+
placeholder="Password"
40+
autocomplete="new-password"
4041
required
4142
minlength="8"
4243
title="Password must be at least 8 characters long"
4344
/>
44-
<button class="password-toggle" type="button">
45+
<button class="password-toggle" type="button" aria-label="Show password">
4546
<i class="ri-eye-off-line"></i>
4647
</button>
4748
</div>
@@ -53,10 +54,11 @@ import { getPathPrefix } from '../../../../utils/path.js'
5354
type="password"
5455
class="form-control password-input"
5556
id="confirm-password"
56-
placeholder="Re-enter your new password"
57+
placeholder="Password"
58+
autocomplete="new-password"
5759
required
5860
/>
59-
<button class="password-toggle" type="button">
61+
<button class="password-toggle" type="button" aria-label="Show password">
6062
<i class="ri-eye-off-line"></i>
6163
</button>
6264
</div>

src/html/pages/authentication/basic/register.astro

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { getPathPrefix } from '../../../../utils/path.js'
3030
class="form-control"
3131
id="fullName"
3232
placeholder="John Doe"
33+
autocomplete="name"
3334
required
3435
/>
3536
</div>
@@ -41,6 +42,7 @@ import { getPathPrefix } from '../../../../utils/path.js'
4142
class="form-control"
4243
id="email"
4344
placeholder="m@example.com"
45+
autocomplete="username"
4446
required
4547
/>
4648
</div>
@@ -52,10 +54,11 @@ import { getPathPrefix } from '../../../../utils/path.js'
5254
type="password"
5355
class="form-control password-input"
5456
id="password"
55-
placeholder="Enter password"
57+
placeholder="Password"
58+
autocomplete="new-password"
5659
required
5760
/>
58-
<button class="password-toggle" type="button">
61+
<button class="password-toggle" type="button" aria-label="Show password">
5962
<i class="ri-eye-off-line"></i>
6063
</button>
6164
</div>
@@ -68,10 +71,11 @@ import { getPathPrefix } from '../../../../utils/path.js'
6871
type="password"
6972
class="form-control password-input"
7073
id="confirmPassword"
71-
placeholder="Confirm your password"
74+
placeholder="Password"
75+
autocomplete="new-password"
7276
required
7377
/>
74-
<button class="password-toggle" type="button">
78+
<button class="password-toggle" type="button" aria-label="Show password">
7579
<i class="ri-eye-off-line"></i>
7680
</button>
7781
</div>

src/html/pages/authentication/basic/verify-email.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ import { getPathPrefix } from '../../../../utils/path.js'
2929
<!-- Verification Code Form -->
3030
<form class="text-start mb-3">
3131
<div class="mb-3">
32-
<label for="verification-code" class="form-label">Verification Code</label>
32+
<label for="verification-code" class="form-label">Enter the verification code</label>
3333
<input
3434
type="text"
3535
class="form-control"
3636
id="verification-code"
37-
placeholder="Enter the verification code"
37+
placeholder="Verification code"
3838
required
3939
maxlength="6"
4040
pattern="[0-9]{6}"

src/html/pages/authentication/compact-split/2-step-verification-code.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ import { getAssetPrefix } from '../../../../utils/path.js'
8181
/>
8282
</div>
8383
<div class="form-check text-start mb-3">
84-
<input class="form-check-input" type="checkbox" id="dontAskAgain" />
8584
<label class="form-check-label" for="dontAskAgain">
85+
<input class="form-check-input" type="checkbox" id="dontAskAgain" />
8686
Do not ask again on this device
8787
</label>
8888
</div>

src/html/pages/authentication/compact-split/2-step-verification.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { getAssetPrefix } from '../../../../utils/path.js'
5353
id="phone"
5454
placeholder="Enter your phone number"
5555
pattern="[0-9]{10}"
56+
autocomplete="tel"
5657
required
5758
/>
5859
</div>

0 commit comments

Comments
 (0)