From 9e07bc89f191a9af8ccd2a783c69491b744bb0ca Mon Sep 17 00:00:00 2001 From: Chidi Ekuma Date: Fri, 26 Apr 2024 10:25:18 +0100 Subject: [PATCH] Update the placement of the location field validation error summary in candidate school search --- app/webpacker/controllers/autocomplete_controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/webpacker/controllers/autocomplete_controller.js b/app/webpacker/controllers/autocomplete_controller.js index 610d35dfe..e1b8faed0 100644 --- a/app/webpacker/controllers/autocomplete_controller.js +++ b/app/webpacker/controllers/autocomplete_controller.js @@ -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 = ` @@ -82,7 +83,7 @@ export default class extends Controller { `; - form.insertAdjacentHTML('afterbegin', errorSummaryHtml); + gridColumn.insertAdjacentHTML('beforebegin', errorSummaryHtml); } }