From 76c8a7be6c92f162dcefb5d4e0577f8e8b4657a7 Mon Sep 17 00:00:00 2001 From: Chloe Zermatten Date: Tue, 1 Apr 2025 14:05:13 +0000 Subject: [PATCH] Bug 39489: 'Refine your search' aria-expanded attribute On smaller screens (phones, tablets), the 'Refine your search' expandable section in the Koha OPAC is not clearly announced by screen readers. The reason for this is that the expandable section toggle button is instead identified and announced as a link. This results in screen reader users incorrectly expecting to be redirected to another page, and not being informed that there is a expandable section. For elements with a class of menu-collapse-toggle, add an aria-expanded attribute which defaults to false, and is toggled to true upon that specific section being expanded. If the screen width is 992px or higher, then remove the aria-expanded attribute on load as it is irrelevant, and potentially misleading. To test: 1) Apply the patch. on a small screen: 2) Run a library catalogue search in the Koha OPAC. 3) Right click on the page to inspect it. 4) Inspect the 'Refine your search' element. 5) Notice that it now has a aria-expanded attribute which is set to false. 6) Open the expandable 'Refine your search' section. 7) Notice that the aria-expanded attribute on the 'Refinine your search' element is now set to true. 8) Navigate to Home > Most popular titles 9) Repeat steps 3-7 10) Navigate to Home > Details for > Full subscription history 11) Repeat steps 3-7 then, on a bigger screen (992px and above) 12) Run a library catalogue search in the Koha OPAC. 13) Right click on the page to inspect it. 14) Inspect the 'Refine your search' element. 15) Notice that there is no 'aria-expanded' attribute, as in this case the section isn't expandable. 16) Resize your viewport below 992px, and notice that 'aria-expanded' reappears and is set to false. 17) Resize your viewport while remaining below the 992px limit, and notice that 'aria-expanded' remains set to false. 18) Open 'Refine your search', notice that 'aria-expanded' is set to true. 19) Resize your viewport while remaining below the 992px limit, and notice that 'aria-expanded' remains set to true. Note: now updated to handle screen resizes Signed-off-by: David Nind --- .../opac-tmpl/bootstrap/en/includes/opac-facets.inc | 2 +- .../bootstrap/en/includes/opac-topissues.inc | 2 +- .../bootstrap/en/modules/opac-full-serial-issues.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/js/global.js | 11 ++++++++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc index 180eee8561..e56965d663 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc @@ -6,7 +6,7 @@ [% SET OPACResultsSidebar = AdditionalContents.get( location => "OPACResultsSidebar", lang => lang, library => logged_in_user.branchcode || default_branch ) %] [% IF ( opacfacets && facets_loop && total ) %]
-

Refine your search

+