Skip to content

Commit a9c8ceb

Browse files
Merge pull request #789 from TechnologyEnhancedLearning/Develop/Fixes/TD-4180-Updating-View-Component-files
TD-4180: Updating View Component files
2 parents 01ef101 + 244e597 commit a9c8ceb

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

LearningHub.Nhs.WebUI/Views/Shared/Components/DateInput/Default.cshtml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
var yearErrorCss = Model.HasYearError ? "nhsuk-input--error" : "";
99
var hintTextLine = string.Empty;
1010
}
11-
11+
@* Removed pattern property *@
1212
<div class="@Model.CssClass @errorCss" id="@Model.Id">
1313
<fieldset class="nhsuk-fieldset" aria-describedby="@Model.Id-hint" role="group">
1414
<legend class="nhsuk-fieldset__legend nhsuk-label">
@@ -54,12 +54,12 @@
5454
id="@Model.DayId"
5555
name="@Model.DayId"
5656
value="@Model.DayValue"
57-
type="number"
58-
pattern="[0-9]*"
57+
type="text"
5958
min="1"
6059
max="31"
6160
step="1"
62-
inputmode="numeric" />
61+
inputmode="numeric"
62+
aria-describedby="date-error" aria-invalid="false" />
6363
</div>
6464
</div>
6565
<div class="nhsuk-date-input__item">
@@ -69,12 +69,12 @@
6969
id="@Model.MonthId"
7070
name="@Model.MonthId"
7171
value="@Model.MonthValue"
72-
type="number"
73-
pattern="[0-9]*"
72+
type="text"
7473
min="1"
7574
max="12"
7675
step="1"
77-
inputmode="numeric" />
76+
inputmode="numeric"
77+
aria-describedby="date-error" aria-invalid="false" />
7878
</div>
7979
</div>
8080
<div class="nhsuk-date-input__item">
@@ -84,12 +84,12 @@
8484
id="@Model.YearId"
8585
name="@Model.YearId"
8686
value="@Model.YearValue"
87-
type="number"
88-
pattern="[0-9]*"
87+
type="text"
8988
min="1900"
9089
max="9999"
9190
step="1"
92-
inputmode="numeric" />
91+
inputmode="numeric"
92+
aria-describedby="date-error" aria-invalid="false" />
9393
</div>
9494
</div>
9595
</div>

LearningHub.Nhs.WebUI/Views/Shared/Components/ErrorSummary/Default.cshtml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
</ul>
2222
</div>
2323
</div>
24+
<script>
25+
const errorSummary = document.querySelector("#error-summary-title").parentElement;
26+
errorSummary.focus();
27+
</script>
2428
}
2529
else
2630
{

LearningHub.Nhs.WebUI/Views/Shared/Components/RadioList/Default.cshtml

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

1010
<div class="nhsuk-form-group @(Model.HasError ? "nhsuk-form-group--error" : "")">
1111

12-
<fieldset class="nhsuk-fieldset" aria-describedby="@(!string.IsNullOrEmpty(Model.HintText) ? $"{Model.Label.RemoveWhitespace()}-hint" : string.Empty)">
12+
<fieldset id="@Model.AspFor" class="nhsuk-fieldset" aria-describedby="@(!string.IsNullOrEmpty(Model.HintText) ? $"{Model.Label.RemoveWhitespace()}-hint" : string.Empty)">
1313
<legend class="nhsuk-fieldset__legend nhsuk-fieldset__legend--m">
1414
@if (Model.IsPageHeading.GetValueOrDefault() == true)
1515
{
@@ -44,7 +44,7 @@
4444

4545
@if (Model.Required && !Model.HasError)
4646
{
47-
<div data-valmsg-for="@Model.AspFor" data-valmsg-replace="true" class="error-message--margin-bottom-1 nhsuk-error-message field-validation-valid nhsuk-u-padding-top-1 nhsuk-u-padding-bottom-3">
47+
<div data-valmsg-for="@Model.AspFor" data-valmsg-replace="true" class="error-message--margin-bottom-1 nhsuk-error-message field-validation-valid nhsuk-u-padding-top-1 nhsuk-u-padding-bottom-3" aria-live="assertive" role="alert">
4848
</div>
4949
}
5050

@@ -131,5 +131,4 @@
131131

132132
</div>
133133
</fieldset>
134-
135134
</div>

0 commit comments

Comments
 (0)