Fix reference to non-existent jQuery collection

Raised on PR as comment:

https://github.com/alphagov/notifications-admin/pull/2880/commits/e4b4be9d459b73196bb5c403cdec881f68462440#r270781103
This commit is contained in:
Tom Byers
2019-04-03 14:41:09 +01:00
parent 8d5e7e70ab
commit cb55fbb344
+3 -3
View File
@@ -2,14 +2,14 @@
"use strict"; "use strict";
Modules.Autofocus = function() { Modules.Autofocus = function() {
this.start = function($component) { this.start = function(component) {
var forceFocus = $component.data('forceFocus'); var forceFocus = $(component).data('forceFocus');
// if the page loads with a scroll position, we can't assume the item to focus onload // if the page loads with a scroll position, we can't assume the item to focus onload
// is still where users intend to start // is still where users intend to start
if (($(window).scrollTop() > 0) && !forceFocus) { return; } if (($(window).scrollTop() > 0) && !forceFocus) { return; }
$('input, textarea, select', $component).eq(0).trigger('focus'); $('input, textarea, select', component).eq(0).trigger('focus');
}; };
}; };