Bug 32420 - Set focus for cursor to barcode input box in batch item modification
Summary: Set focus for cursor to barcode input box in batch item modification
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-07 16:41 UTC by Caroline Cyr La Rose
Modified: 2024-05-23 11:18 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 32420: Set focus for cursor to barcode input box in batch item modification (1.46 KB, patch)
2022-12-16 10:28 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 32420: Set focus for cursor to barcode input box in batch item modification (1.50 KB, patch)
2022-12-16 16:52 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 32420: (follow-up) Set focus for cursor to barcode input box in batch item modification (1.96 KB, patch)
2024-04-13 12:30 UTC, Paul Derscheid
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2022-12-07 16:41:19 UTC
It would be great if the focus would be automatically set to the barcode input box in the batch item modification screen.

Right now, the focus is on the catalogue search. But if you went to that page, you went to batch edit item. 

To test:
1. Go to Cataloging > Batch item modification
   --> Notice that the cursor is set to the 'Search catalog' box at the top of the page, it would be better to have it in the barcode input box under 'Scan items one by one'
Comment 1 Paul Derscheid 2022-12-16 10:28:34 UTC
Created attachment 144642 [details] [review]
Bug 32420: Set focus for cursor to barcode input box in batch item modification

This should do it. Don't know whether it's compatible with the JS guidelines in the wiki.
But I don't know whether it makes that much sense to move this block to
one of the included scripts.

To test:
1. Go to Cataloging > Batch item modification
	--> The barcodelist input field is now selected by default in
the 'batch item modification' as well as the 'batch item deletion' view.

https://bugs.koha-community.org/show_bug.cgi?id=32418
Comment 2 Lucas Gass (lukeg) 2022-12-16 16:52:14 UTC
Created attachment 144694 [details] [review]
Bug 32420: Set focus for cursor to barcode input box in batch item modification

This should do it. Don't know whether it's compatible with the JS guidelines in the wiki.
But I don't know whether it makes that much sense to move this block to
one of the included scripts.

To test:
1. Go to Cataloging > Batch item modification
	--> The barcodelist input field is now selected by default in
the 'batch item modification' as well as the 'batch item deletion' view.

https://bugs.koha-community.org/show_bug.cgi?id=32418

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 3 Katrin Fischer 2022-12-28 21:52:25 UTC
Hi Paul, thx for the patch!

Your patch works, but there is a standard way to achieve this, that is a little nicer:

-                                      <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
+                                      <textarea class="focus" rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>

By adding the class 'focus' some magic will happen :)
Comment 4 Paul Derscheid 2024-04-13 12:30:24 UTC
Created attachment 164866 [details] [review]
Bug 32420: (follow-up) Set focus for cursor to barcode input box in batch item modification

Patch now uses cait's suggestion: the `focus` class.

To test:
1. Go to Cataloging > Batch item modification
2. Check that the barcodelist textarea isn't focused by default.
3. Apply patch.
4. Go to Cataloging > Batch item modification
5. Check that the barcodelist textarea is now selected by default in
the 'batch item modification' as well as the 'batch item deletion' view.
Comment 5 Caroline Cyr La Rose 2024-04-15 14:30:04 UTC
Hi Paul,

I tried to apply the patches, but it gives me an error. 

Should the old patch be obsoleted?

Caroline