Bugzilla – Attachment 180705 Details for
Bug 39489
'Refine your search' should have an aria-expanded attribute
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39489: 'Refine your search' aria-expanded attribute
Bug-39489-Refine-your-search-aria-expanded-attribu.patch (text/plain), 4.92 KB, created by
Brendan Gallagher
on 2025-04-07 19:16:48 UTC
(
hide
)
Description:
Bug 39489: 'Refine your search' aria-expanded attribute
Filename:
MIME Type:
Creator:
Brendan Gallagher
Created:
2025-04-07 19:16:48 UTC
Size:
4.92 KB
patch
obsolete
>From 402bfd04085c591765241827a66bc8aa4a6fa7ac Mon Sep 17 00:00:00 2001 >From: Chloe Zermatten <chloe.zermatten@openfifth.co.uk> >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 the section being expanded. > >To test: > >1) Apply the patch. >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 > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc | 2 +- > .../opac-tmpl/bootstrap/en/includes/opac-topissues.inc | 2 +- > .../bootstrap/en/modules/opac-full-serial-issues.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/js/global.js | 6 ++++++ > 4 files changed, 9 insertions(+), 3 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 ) %] > <div id="search-facets"> >- <h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2> >+ <h2><a href="#" class="menu-collapse-toggle" aria-expanded="false">Refine your search</a></h2> > <ul class="menu-collapse"> > [% IF Koha.Preference("SavedSearchFilters") && search_filters.size > 0 %] > <li id="search-filters"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc >index 4753ae139f..b6c53f7b47 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc >@@ -5,7 +5,7 @@ > > <div id="search-facets"> > <form method="get" action="/cgi-bin/koha/opac-topissues.pl"> >- <h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2> >+ <h2><a href="#" class="menu-collapse-toggle" aria-expanded="false">Refine your search</a></h2> > <ul class="menu-collapse"> > <li > ><label for="limit">Show the top </label> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-full-serial-issues.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-full-serial-issues.tt >index 7708778a89..7b57671dcb 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-full-serial-issues.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-full-serial-issues.tt >@@ -76,7 +76,7 @@ > <div id="search-facets"> > <form method="get" action="/cgi-bin/koha/opac-serial-issues.pl" id="filterform"> > <legend >- ><h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2></legend >+ ><h2><a href="#" class="menu-collapse-toggle" aria-expanded="false">Refine your search</a></h2></legend > > > <ul class="menu-collapse"> > <li> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >index a3c5a3ce86..ea6c713c88 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >@@ -247,8 +247,14 @@ var facetHandler = function (e) { > e.preventDefault(); > $(this).toggleClass("menu-open"); > $(".menu-collapse").toggle(); >+ setAriaExpandable(); > }; > >+function setAriaExpandable() { >+ let currentValue = $(".menu-collapse-toggle").attr("aria-expanded"); >+ $(".menu-collapse-toggle").attr("aria-expanded", currentValue === "false"); >+} >+ > function setPlaceholder() { > let search_placeholder = $("#masthead_search option:selected").data( > "placeholder" >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39489
:
180300
|
180705
|
181372
|
181568
|
182489
|
182565
|
182735
|
183057