mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
This commit adds a very small Javascript module to autofocus a textbox on page load. It should only be used once per page. It also adds a parameter to the textbox macro which adds the attribute to trigger autofocus.
13 lines
223 B
JavaScript
13 lines
223 B
JavaScript
(function(Modules) {
|
|
"use strict";
|
|
|
|
Modules.Autofocus = function() {
|
|
this.start = function(component) {
|
|
|
|
$('input, textarea, select', component).eq(0).trigger('focus');
|
|
|
|
};
|
|
};
|
|
|
|
})(window.GOVUK.Modules);
|