Bug 40780

Summary: Removing rows on advanced search should not lose focus
Product: Koha Reporter: Jake Deery <jake.deery>
Component: OPACAssignee: Jake Deery <jake.deery>
Status: Needs documenting --- QA Contact: Jonathan Druart <jonathan.druart>
Severity: trivial    
Priority: P5 - low CC: e.betemps, fridolin.somers, jake.deery, lucas
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Crowdfunding goal: 0
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.04
Circulation function:
Attachments: Bug 40780: Advsearch ButtonMinus moves focus to next or prev line
Bug 40780: Advsearch ButtonMinus moves focus to next or prev line
Bug 40780: Advsearch ButtonMinus moves focus to next or prev line

Description Jake Deery 2025-09-10 08:55:29 UTC
When removing search fields on the advanced search page of the OPAC, focus is lost. This shouldn't happen; focus should move to a sane location instead.
Comment 1 Jake Deery 2025-09-10 08:56:46 UTC
Created attachment 186309 [details] [review]
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
Comment 2 Emmanuel Bétemps 2025-09-15 09:04:23 UTC
Created attachment 186399 [details] [review]
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

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Comment 3 Jonathan Druart 2025-09-16 09:38:25 UTC
Created attachment 186467 [details] [review]
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

Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Lucas Gass (lukeg) 2025-09-18 19:54:43 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 5 Paul Derscheid 2025-09-25 16:31:15 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 6 Fridolin Somers 2025-10-16 08:20:26 UTC
Not easy to apply on 24.11.x, since it is minor I skip