Bugzilla – Attachment 186309 Details for
Bug 40780
Removing rows on advanced search should not lose focus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40780: Advsearch ButtonMinus moves focus to next or prev line
Bug-40780-Advsearch-ButtonMinus-moves-focus-to-nex.patch (text/plain), 2.67 KB, created by
Jake Deery
on 2025-09-10 08:56:46 UTC
(
hide
)
Description:
Bug 40780: Advsearch ButtonMinus moves focus to next or prev line
Filename:
MIME Type:
Creator:
Jake Deery
Created:
2025-09-10 08:56:46 UTC
Size:
2.67 KB
patch
obsolete
>From c0836e3f133c68ced5b8e9a4fce243f9fa4c5eba Mon Sep 17 00:00:00 2001 >From: Jake Deery <jake.deery@openfifth.co.uk> >Date: Tue, 9 Sep 2025 09:44:43 +0000 >Subject: [PATCH] Bug 40780: Advsearch ButtonMinus moves focus to next or prev > line > >This patch will cause the ButtonMinus button on each of the advsearch >fieldsets to jump the focus to the next or previous line, whichever is >available. This is in response to a recent accessibility audit performed >by one of our customers. Thanks! > >TO TEST: >a) go to /cgi-bin/koha/opac-search.pl?expanded_options=1 >b) click / tab onto the ButtonMinus next to a field, click / press >enter >c) notice how the focus disappears >APPLY PATCH >d) repeat steps a-b >e) notice how the focus now either goes to the next line (if available) >or the previous line (otherwise) >SIGN OFF >--- > .../bootstrap/en/modules/opac-advsearch.tt | 25 ++++++++++++++++--- > 1 file changed, 21 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >index 76f779508fb..a4651d0a4e3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >@@ -614,13 +614,30 @@ > thisLine.after(newLine); > }); > >- $(document).on("click", '.ButtonLess', function(e) { >+ $(document).on('click', '.ButtonLess', function (e) { > e.preventDefault(); >- if( $("a.ButtonLess").length <= 2 ) { >- $('.ButtonLess').hide(); >+ if ($('a.ButtonLess').length <= 2) { >+ $('.ButtonLess').hide(); > } >+ >+ let first = $(this).parent().parent().first(); >+ let next = $(this).parent().parent().next(); >+ let prev = $(this).parent().parent().prev(); >+ > $(this).parent().parent().remove(); >- $('.search-term-row .search-term-input select[name="op"]').first().prop("disabled",true).hide(); >+ $('.search-term-row .search-term-input select[name="op"]').first().prop('disabled', true).hide(); >+ >+ let firstInput = first.find(':input:not(:disabled)').first(); >+ let nextInput = next.find(':input:not(:disabled)').first(); >+ let prevInput = prev.find(':input:not(:disabled)').first(); >+ >+ if (nextInput.length > 0) { >+ nextInput.focus(); >+ } else if (prevInput.length > 0) { >+ prevInput.focus(); >+ } else { >+ firstInput.focus(); >+ } > }); > </script> > [% END %] >-- >2.43.0
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 40780
: 186309