Skip to content

Commit 232c47e

Browse files
github-actions[bot]captainsafia
authored andcommitted
[release/9.0] [Identity][Templates] Ensure placeholders don't overlap with text (#57789)
Backport of #57783 to release/9.0 /cc @javiercn # [Identity][Templates] Ensure placeholders don't overlap with text Placeholder text on input textboxes overlaps with the label texts. ## Description * As part of an accessibility fix, we started displaying placeholders on input elements. * In some circumstances, these placeholders overlap with the labels on the input text boxes, making it problematic to read them. * The fix addresses this by reducing the size of the placeholders and making inputs bigger to avoid any overlap. Fixes dotnet/AspNetCore-ManualTests#3081 ## Customer Impact When the window size is small enough, customers could see overlapped text that's hard to read and is sometimes even impossible. ## Regression? - [X] Yes - [ ] No 8.0 since we introduced this behavior on 9.0 as part of accessibility fixes. ## Risk - [ ] High - [ ] Medium - [x] Low The attached videos serve as validation of the fix, in addition to that, the UI is completely customizable by customers. ## Verification - [X] Manual (required) - [ ] Automated **Old behavior** ![image](https://github.com/user-attachments/assets/ae72b769-7215-4b0a-954b-a59fb84fbb7d) ![image](https://github.com/user-attachments/assets/f9e32542-7aa7-47ba-876e-567435ef4bdc) **New behavior** https://github.com/user-attachments/assets/6eae3396-9794-402d-af65-e0bc89257a44 https://github.com/user-attachments/assets/0343b4fc-5f55-4e46-a276-67c4c97645e2 ## Packaging changes reviewed? - [ ] Yes - [ ] No - [X] N/A ---- ## When servicing release/2.1 - [ ] Make necessary changes in eng/PatchConfig.props
1 parent 15c8656 commit 232c47e

File tree

16 files changed

+42
-42
lines changed

16 files changed

+42
-42
lines changed

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Login.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<h1>@ViewData["Title"]</h1>
99
<div class="row">
10-
<div class="col-md-4">
10+
<div class="col-lg-6">
1111
<section>
1212
<form id="account" method="post">
1313
<h2>Use a local account to log in.</h2>
@@ -46,7 +46,7 @@
4646
</form>
4747
</section>
4848
</div>
49-
<div class="col-md-6 col-md-offset-2">
49+
<div class="col-lg-4 col-lg-offset-2">
5050
<section>
5151
<h3>Use another service to log in.</h3>
5252
<hr />

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/ChangePassword.cshtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
<h3>@ViewData["Title"]</h3>
99
<partial name="_StatusMessage" for="StatusMessage" />
1010
<div class="row">
11-
<div class="col-md-6">
11+
<div class="col-xl-6">
1212
<form id="change-password-form" method="post">
1313
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
1414
<div class="form-floating mb-3">
15-
<input asp-for="Input.OldPassword" class="form-control" autocomplete="current-password" aria-required="true" placeholder="Please enter your old password." />
15+
<input asp-for="Input.OldPassword" class="form-control" autocomplete="current-password" aria-required="true" placeholder="Enter the old password" />
1616
<label asp-for="Input.OldPassword" class="form-label"></label>
1717
<span asp-validation-for="Input.OldPassword" class="text-danger"></span>
1818
</div>
1919
<div class="form-floating mb-3">
20-
<input asp-for="Input.NewPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Please enter your new password." />
20+
<input asp-for="Input.NewPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Enter the new password" />
2121
<label asp-for="Input.NewPassword" class="form-label"></label>
2222
<span asp-validation-for="Input.NewPassword" class="text-danger"></span>
2323
</div>
2424
<div class="form-floating mb-3">
25-
<input asp-for="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Please confirm your new password."/>
25+
<input asp-for="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Enter the new password"/>
2626
<label asp-for="Input.ConfirmPassword" class="form-label"></label>
2727
<span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
2828
</div>

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Email.cshtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
<h3>@ViewData["Title"]</h3>
99
<partial name="_StatusMessage" for="StatusMessage" />
1010
<div class="row">
11-
<div class="col-md-6">
11+
<div class="col-xl-6">
1212
<form id="email-form" method="post">
1313
<div asp-validation-summary="All" class="text-danger" role="alert"></div>
1414
@if (Model.IsEmailConfirmed)
1515
{
1616
<div class="form-floating mb-3 input-group">
17-
<input asp-for="Email" class="form-control" placeholder="Please enter your email." disabled />
17+
<input asp-for="Email" class="form-control" placeholder="Enter your email" disabled />
1818
<div class="input-group-append">
1919
<span class="h-100 input-group-text text-success font-weight-bold">✓</span>
2020
</div>
@@ -24,13 +24,13 @@
2424
else
2525
{
2626
<div class="form-floating mb-3">
27-
<input asp-for="Email" class="form-control" placeholder="Please enter your email." disabled />
27+
<input asp-for="Email" class="form-control" placeholder="Enter your email" disabled />
2828
<label asp-for="Email" class="form-label"></label>
2929
<button id="email-verification" type="submit" asp-page-handler="SendVerificationEmail" class="btn btn-link">Send verification email</button>
3030
</div>
3131
}
3232
<div class="form-floating mb-3">
33-
<input asp-for="Input.NewEmail" class="form-control" autocomplete="email" aria-required="true" placeholder="Please enter new email." />
33+
<input asp-for="Input.NewEmail" class="form-control" autocomplete="email" aria-required="true" placeholder="Enter new email" />
3434
<label asp-for="Input.NewEmail" class="form-label"></label>
3535
<span asp-validation-for="Input.NewEmail" class="text-danger"></span>
3636
</div>

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/EnableAuthenticator.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
with a unique code. Enter the code in the confirmation box below.
3333
</p>
3434
<div class="row">
35-
<div class="col-md-6">
35+
<div class="col-xl-6">
3636
<form id="send-code" method="post">
3737
<div class="form-floating mb-3">
3838
<input asp-for="Input.Code" class="form-control" autocomplete="off" placeholder="Please enter the code."/>

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/Index.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
<form id="profile-form" method="post">
1313
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
1414
<div class="form-floating mb-3">
15-
<input asp-for="Username" class="form-control" placeholder="Please choose your username." disabled />
15+
<input asp-for="Username" class="form-control" placeholder="Choose your username" disabled />
1616
<label asp-for="Username" class="form-label"></label>
1717
</div>
1818
<div class="form-floating mb-3">
19-
<input asp-for="Input.PhoneNumber" class="form-control" placeholder="Please enter your phone number."/>
19+
<input asp-for="Input.PhoneNumber" class="form-control" placeholder="Enter your phone number"/>
2020
<label asp-for="Input.PhoneNumber" class="form-label"></label>
2121
<span asp-validation-for="Input.PhoneNumber" class="text-danger"></span>
2222
</div>

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/SetPassword.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
account so you can log in without an external login.
1313
</p>
1414
<div class="row">
15-
<div class="col-md-6">
15+
<div class="col-xl-6">
1616
<form id="set-password-form" method="post">
1717
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
1818
<div class="form-floating mb-3">
19-
<input asp-for="Input.NewPassword" class="form-control" autocomplete="new-password" placeholder="Please enter your new password."/>
19+
<input asp-for="Input.NewPassword" class="form-control" autocomplete="new-password" placeholder="Enter the new password"/>
2020
<label asp-for="Input.NewPassword" class="form-label"></label>
2121
<span asp-validation-for="Input.NewPassword" class="text-danger"></span>
2222
</div>
2323
<div class="form-floating mb-3">
24-
<input asp-for="Input.ConfirmPassword" class="form-control" autocomplete="new-password" placeholder="Please confirm your new password."/>
24+
<input asp-for="Input.ConfirmPassword" class="form-control" autocomplete="new-password" placeholder="Enter the new password"/>
2525
<label asp-for="Input.ConfirmPassword" class="form-label"></label>
2626
<span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
2727
</div>

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Manage/_Layout.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
<h2>Change your account settings</h2>
1616
<hr />
1717
<div class="row">
18-
<div class="col-md-3">
18+
<div class="col-lg-3">
1919
<partial name="_ManageNav" />
2020
</div>
21-
<div class="col-md-9">
21+
<div class="col-lg-9">
2222
@RenderBody()
2323
</div>
2424
</div>

src/Identity/UI/src/Areas/Identity/Pages/V5/Account/Register.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<h1>@ViewData["Title"]</h1>
88

99
<div class="row">
10-
<div class="col-md-4">
10+
<div class="col-lg-6">
1111
<form id="registerForm" asp-route-returnUrl="@Model.ReturnUrl" method="post">
1212
<h2>Create a new account.</h2>
1313
<hr />
@@ -30,7 +30,7 @@
3030
<button id="registerSubmit" type="submit" class="w-100 btn btn-lg btn-primary">Register</button>
3131
</form>
3232
</div>
33-
<div class="col-md-6 col-md-offset-2">
33+
<div class="col-lg-4 col-lg-offset-2">
3434
<section>
3535
<h3>Use another service to register.</h3>
3636
<hr />

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Account/Pages/Login.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<h1>Log in</h1>
1616
<div class="row">
17-
<div class="col-md-4">
17+
<div class="col-lg-6">
1818
<section>
1919
<StatusMessage Message="@errorMessage" />
2020
<EditForm Model="Input" method="post" OnValidSubmit="LoginUser" FormName="login">
@@ -55,7 +55,7 @@
5555
</EditForm>
5656
</section>
5757
</div>
58-
<div class="col-md-6 col-md-offset-2">
58+
<div class="col-lg-4 col-lg-offset-2">
5959
<section>
6060
<h3>Use another service to log in.</h3>
6161
<hr />

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Account/Pages/Manage/ChangePassword.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@
1515
<h3>Change password</h3>
1616
<StatusMessage Message="@message" />
1717
<div class="row">
18-
<div class="col-md-6">
18+
<div class="col-xl-6">
1919
<EditForm Model="Input" FormName="change-password" OnValidSubmit="OnValidSubmitAsync" method="post">
2020
<DataAnnotationsValidator />
2121
<ValidationSummary class="text-danger" role="alert" />
2222
<div class="form-floating mb-3">
23-
<InputText type="password" @bind-Value="Input.OldPassword" id="Input.OldPassword" class="form-control" autocomplete="current-password" aria-required="true" placeholder="Please enter your old password." />
23+
<InputText type="password" @bind-Value="Input.OldPassword" id="Input.OldPassword" class="form-control" autocomplete="current-password" aria-required="true" placeholder="Enter the old password" />
2424
<label for="Input.OldPassword" class="form-label">Old password</label>
2525
<ValidationMessage For="() => Input.OldPassword" class="text-danger" />
2626
</div>
2727
<div class="form-floating mb-3">
28-
<InputText type="password" @bind-Value="Input.NewPassword" id="Input.NewPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Please enter your new password." />
28+
<InputText type="password" @bind-Value="Input.NewPassword" id="Input.NewPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Enter the new password" />
2929
<label for="Input.NewPassword" class="form-label">New password</label>
3030
<ValidationMessage For="() => Input.NewPassword" class="text-danger" />
3131
</div>
3232
<div class="form-floating mb-3">
33-
<InputText type="password" @bind-Value="Input.ConfirmPassword" id="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Please confirm your new password." />
33+
<InputText type="password" @bind-Value="Input.ConfirmPassword" id="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="Enter the new password" />
3434
<label for="Input.ConfirmPassword" class="form-label">Confirm password</label>
3535
<ValidationMessage For="() => Input.ConfirmPassword" class="text-danger" />
3636
</div>

0 commit comments

Comments
 (0)