Be more strategic about autofocus usage in the OPAC

Bug #1796225 reported by Jane Sandberg
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

Currently, the following pages autofocus on the search box, even though searching is not the purpose of the page:
* https://demo.evergreencatalog.com/eg/opac/results?query=cat
* https://demo.evergreencatalog.com/eg/opac/record/8405?query=cat
* https://demo.evergreencatalog.com/eg/opac/library/SL1
* https://demo.evergreencatalog.com/eg/opac/mylist
* https://demo.evergreencatalog.com/eg/opac/password_reset

This is problematic from an accessibility perspective, see the following:
* https://www.brucelawson.co.uk/2009/the-accessibility-of-html-5-autofocus/
* https://stackoverflow.com/a/2180699/5636330

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: https://github.com/evergreen-library-system/Evergreen/blob/ecee476ede872cc671c8fe4887eb6194d6b9ef85/Open-ILS/src/templates/opac/parts/searchbar.tt2#L65

tags: added: opac
Revision history for this message
Jane Sandberg (sandbergja) 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: http://git.evergreen-ils.org/?p=working/Evergreen.git;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
Revision history for this message
Jane Sandberg (sandbergja) wrote :

I meant conservative, not conservation! :-)

Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
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)
Changed in evergreen:
milestone: none → 3.3-beta1
Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
milestone: 3.3-beta1 → 3.2.4
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.