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); } }