Autofocus old and new error messages

Previously all our error messages had the class `error-message`.

Where we are using the components from GOV.UK Frontend they have the
class `govuk-error-message`.

This makes the code which jumps focus to the first error work in both
cases.
This commit is contained in:
Chris Hill-Scott
2021-11-04 11:52:26 +00:00
parent e3089af1ef
commit 538bc63f98

View File

@@ -17,7 +17,7 @@ showHideContent.init();
$(() => GOVUK.modules.start());
$(() => $('.error-message').eq(0).parent('label').next('input').trigger('focus'));
$(() => $('.error-message, .govuk-error-message').eq(0).parent('label').next('input').trigger('focus'));
$(() => $('.banner-dangerous').eq(0).trigger('focus'));