mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Automatically focus the first form field error
Because we’re not showing a summary of error messages screen reader users might take a while to discover that there’s an error on the page. Since the only real action on a page with errors is to correct them this commit adds some Javascript to send focus straight to the first error message on a page.
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
$(() => GOVUK.modules.start());
|
$(() => GOVUK.modules.start());
|
||||||
|
|
||||||
$(() => new GOVUK.SelectionButtons('.block-label input, .sms-message-option input'));
|
$(() => new GOVUK.SelectionButtons('.block-label input, .sms-message-option input'));
|
||||||
|
|
||||||
|
$(() => $('.error-message').eq(0).parent('label').next('input').trigger('focus'));
|
||||||
|
|||||||
Reference in New Issue
Block a user