Bug 29613

Summary: Set focus for cursor to barcode field on course reserves add items and batch add items pages
Product: Koha Reporter: Eliana <eliana>
Component: Course reservesAssignee: Bugs List <koha-bugs>
Status: CLOSED WORKSFORME QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low    
Version: 21.05   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Screenshot of current behavior
Screenshot of current behavior

Description Eliana 2021-12-01 16:54:20 UTC
When clicking on the "Add reserves" or "batch add reserves" buttons in the course reserves module, the cursor focuses on the catalog search bar instead of the box where you scan in the barcodes. I fixed this locally by adding the following to IntranetUserJS:

//Switch active cursor to correct box for adding course reserves
$(document).ready(function(){
if (window.location.href.indexOf("cgi-bin/koha/course_reserves/add_items.pl") > -1) {
 $('#barcode').focus();
}
});

$(document).ready(function(){
if (window.location.href.indexOf("cgi-bin/koha/course_reserves/batch_add_items.pl") > -1) {
 $('#barcodes').focus();
}
});
Comment 1 Eliana 2021-12-01 16:55:25 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2021-12-03 13:26:01 UTC
Created attachment 128213 [details]
Screenshot of current behavior
Comment 3 Owen Leonard 2021-12-03 14:57:20 UTC
I can't reproduce this problem in master or 21.05.x
Comment 4 Katrin Fischer 2022-01-09 00:13:20 UTC
Same for me, I tested this on 20.11 and the current development version. The cursor is always in the barcode field for me.

Eliana, please provide your exact version if this problem still persists. Please also try to remove all your changes from OpacUserJs and test without them to make sure it's not another change interfering.
Comment 5 Eliana 2022-01-10 14:52:50 UTC
Katrin was right, it was another bit of our JQuery that was causing this issue. My bad! This bug is no long relevant.
Comment 6 Katrin Fischer 2022-01-12 12:19:20 UTC
Thx for the feedback, Eliana, had this happen myself before.