Fix the autofocus component

Since moving textboxes to GOV.UK Frontend we’ve started putting the
data attribute on the `input` element itself, not a wrapper around it.

This commit updates the Javascript accordingly.
This commit is contained in:
Chris Hill-Scott
2020-08-27 08:49:36 +01:00
parent db1f916d34
commit 674c27a693
2 changed files with 4 additions and 4 deletions

View File

@@ -9,7 +9,7 @@
// is still where users intend to start
if (($(window).scrollTop() > 0) && !forceFocus) { return; }
$('input, textarea, select', component).eq(0).trigger('focus');
$(component).filter('input, textarea, select').eq(0).trigger('focus');
};
};