Skip to content

Commit

Permalink
Update the placement of the location field validation error summary i…
Browse files Browse the repository at this point in the history
…n candidate school search
  • Loading branch information
ekumachidi committed Apr 26, 2024
1 parent 7bc221a commit 9e07bc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/webpacker/controllers/autocomplete_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default class extends Controller {

createErrorSummary(errorMessage) {
const errorSummary = document.querySelector('.govuk-error-summary');
const gridColumn = document.querySelector('.govuk-grid-column-full');
if (!errorSummary) {
const form = document.querySelector('.school-search-form');
const errorSummaryHtml = `
Expand All @@ -82,7 +83,7 @@ export default class extends Controller {
</div>
</div>
`;
form.insertAdjacentHTML('afterbegin', errorSummaryHtml);
gridColumn.insertAdjacentHTML('beforebegin', errorSummaryHtml);
}
}

Expand Down

0 comments on commit 9e07bc8

Please sign in to comment.