Be more strategic about autofocus usage in the OPAC

Bug #1796225 reported by Jane Sandberg on 2018-10-05
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

Currently, the following pages autofocus on the search box, even though searching is not the purpose of the page:

This is problematic from an accessibility perspective, see the following:

I think this could be easily fixed by changing this line to check that is_home_page is true as well as basic_search != "f" before adding that autofocus element:

Jane Sandberg (sandbej) on 2018-10-05
tags: added: opac
Jane Sandberg (sandbej) wrote :

I created a branch to make autofocus a lot more conservation. It is called: user/sandbergja/lp1796225_dont_autofocus_searchbar_on_non-search_pages

Here's a link:;a=shortlog;h=refs/heads/user/sandbergja/lp1796225_dont_autofocus_searchbar_on_non-search_pages

And here are the testing notes from the commit message:

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.

tags: added: pullrequest
Jane Sandberg (sandbej) wrote :

I meant conservative, not conservation! :-)

Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Terran McCanna (tmccanna) wrote :

Works like a charm!

I have tested this code and consent to signing off on it with my name, Terran McCanna, and my email address, <email address hidden>.

tags: added: signedoff
Michele Morgan (mmorgan) on 2018-11-19
Changed in evergreen:
milestone: none → 3.3-beta1
Galen Charlton (gmc) on 2019-02-18
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
milestone: 3.3-beta1 → 3.2.4
Galen Charlton (gmc) wrote :

Tested and pushed to master and rel_3_2. Thanks, Jane and Terran!

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Galen Charlton (gmc) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers