For a11y and usability, it's better to autofocus form fields
only when they are the main purpose of a page.
To test:
1) In the public catalog, visit the search results, record view,
library details, basket, and password reset pages. Notice that
the cursor leaps to the search bar in each of these pages.
2) Apply this commit.
3) Re-visit all those pages. Notice that the cursor no longer
leaps to the search bar.
4) Visit the home page of the public catalog. Notice that the
cursor still leaps to the search bar on this page only.
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
store_args='{"org_unit_getter": function() { return [% ctx.search_ou %]; }}'
[%- END # opac_visible -%]
[%- ELSE -%]
- [% IF basic_search != "f" %] autofocus [% END %] x-webkit-speech
+ [% IF basic_search != "f" AND is_home_page %] autofocus [% END %] x-webkit-speech
[%- END # autosuggest enabled %] />
</label>
</span>