diff --git a/app/assets/javascripts/autofocus.js b/app/assets/javascripts/autofocus.js deleted file mode 100644 index b688a9f20..000000000 --- a/app/assets/javascripts/autofocus.js +++ /dev/null @@ -1,27 +0,0 @@ -(function(Modules) { - "use strict"; - - Modules.Autofocus = function() { - this.start = function(component) { - var $component = $(component), - forceFocus = $component.data('forceFocus'); - - // if the page loads with a scroll position, we can't assume the item to focus onload - // is still where users intend to start - if (($(window).scrollTop() > 0) && !forceFocus) { return; } - - // See if the component itself is something we want to send focus to - var target = $component.filter('input, textarea, select'); - - // Otherwise look inside the component to see if there are any elements - // we want to send focus to - if (target.length === 0) { - target = $('input, textarea, select', $component); - } - - target.eq(0).trigger('focus'); - - }; - }; - -})(window.GOVUK.Modules); diff --git a/app/assets/sass/uswds/_main.scss b/app/assets/sass/uswds/_main.scss index 983a72c8c..88e44042d 100644 --- a/app/assets/sass/uswds/_main.scss +++ b/app/assets/sass/uswds/_main.scss @@ -345,8 +345,13 @@ h2.recipient-list { } } -// Button ellipses loading +.usa-search__input, [type=search] { + border-right: 1px solid; + height: 40px; + margin-top: units(1); +} +// Button ellipses loading .dot-anim::after { content: '.'; animation: dotPulse 1.5s steps(3, end) infinite; diff --git a/app/templates/components/live-search.html b/app/templates/components/live-search.html index 58683e957..4f5ad3313 100644 --- a/app/templates/components/live-search.html +++ b/app/templates/components/live-search.html @@ -3,7 +3,7 @@ show=False, form=None, label=None, - autofocus=False + autofocus=True ) %} {%- set search_label = label or form.search.label.text %} @@ -13,7 +13,7 @@ } %} {% if autofocus %} - {% set x=param_extensions.__setitem__("attributes", {"data-module": "autofocus"}) %} + {% set _ = param_extensions.__setitem__("attributes", {"autofocus": "autofocus"}) %} {% endif %} {% if show %} diff --git a/app/templates/views/manage-users.html b/app/templates/views/manage-users.html index 38c87c3bf..4b36e25eb 100644 --- a/app/templates/views/manage-users.html +++ b/app/templates/views/manage-users.html @@ -30,13 +30,13 @@ {% if show_search_box %} -