Bug 27191

Summary: Set focus for cursor to category code input box when creating new patron categories
Product: Koha Reporter: Barbara Johnson <barbara.johnson>
Component: TemplatesAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, gmcharlt, jonathan.druart, kyle, sally.healey, vfaafia29
Version: MainKeywords: Academy
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26694
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This updates the new patron category input form so that the cursor focus is on the category code input field.
Version(s) released in:
22.11.00
Circulation function:
Attachments: bug 27191: Set focus for cursor to category code input box when creating new patron categories
bug 27191: Set focus for cursor to category code input box when creating new patron categories
Bug 27191: Set focus for cursor to category code input box when creating new patron categories
Bug 27191: Set focus on first input when adding a new patron category
Bug 27191: Set focus on first input when adding a new patron category
Bug 27191: Set focus on first input when adding a new patron category
Bug 27191: Set focus on first input when adding a new patron category

Description Barbara Johnson 2020-12-10 16:06:25 UTC
When adding a new patron category on categories.pl you have to click in the category code input box, which is a required field, so that you can enter text.  It would be more efficient to set the focus for the cursor to always be in the category code input box so that you could just begin typing and eliminate an extra click.
Comment 1 Victoria Faafia 2021-01-19 02:05:40 UTC
Created attachment 115283 [details] [review]
bug 27191: Set focus for cursor to category code input box when creating new patron categories

1-Go to admin>patroncategories>newcategory
2-The category code box should be green and already have the cursor inside without you clicking on it
3-Refresh page to double check the cursor automatically goes to the category code box
Comment 2 PTFS Europe Sandboxes 2021-01-19 12:13:01 UTC
Created attachment 115313 [details] [review]
bug 27191: Set focus for cursor to category code input box when creating new patron categories

1-Go to admin>patroncategories>newcategory
2-The category code box should be green and already have the cursor inside without you clicking on it
3-Refresh page to double check the cursor automatically goes to the category code box

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 3 Sally 2021-01-19 12:13:52 UTC
Works as described.
Comment 4 Kyle M Hall (khall) 2021-01-21 19:22:00 UTC
Created attachment 115598 [details] [review]
Bug 27191: Set focus for cursor to category code input box when creating new patron categories

1-Go to admin>patroncategories>newcategory
2-The category code box should be green and already have the cursor inside without you clicking on it
3-Refresh page to double check the cursor automatically goes to the category code box

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Jonathan Druart 2021-01-22 13:09:32 UTC
Focus must be put using the "focus" class instead.
Comment 6 Katrin Fischer 2022-08-18 20:18:11 UTC
Created attachment 139420 [details] [review]
Bug 27191: Set focus on first input when adding a new patron category

When adding a new patron category, the focus/cursor should be
in the first input field of the form: Category code

To test:
* Add a new patron category in administration > patron categories
  - cursur is in no field
* Apply patch
* Add another new patron category
  - cursor is now in the first input field of the form: Category code
Comment 7 Katrin Fischer 2022-08-18 20:20:39 UTC
I implemented the standard solution for setting the focus using the CSS class
as suggested in comment#5. As both patches were one line fixes mine replaces
Victoria's previous patch. I didn't see a better way, if you prefer this as a
follow-up, please let me know.
Comment 8 ByWater Sandboxes 2022-08-18 20:40:09 UTC
Created attachment 139423 [details] [review]
Bug 27191: Set focus on first input when adding a new patron category

When adding a new patron category, the focus/cursor should be
in the first input field of the form: Category code

To test:
* Add a new patron category in administration > patron categories
  - cursur is in no field
* Apply patch
* Add another new patron category
  - cursor is now in the first input field of the form: Category code

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 9 David Nind 2022-08-18 20:45:46 UTC
Created attachment 139426 [details] [review]
Bug 27191: Set focus on first input when adding a new patron category

When adding a new patron category, the focus/cursor should be
in the first input field of the form: Category code

To test:
* Add a new patron category in administration > patron categories
  - cursur is in no field
* Apply patch
* Add another new patron category
  - cursor is now in the first input field of the form: Category code

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 Kyle M Hall (khall) 2022-09-02 14:44:13 UTC
Created attachment 140159 [details] [review]
Bug 27191: Set focus on first input when adding a new patron category

When adding a new patron category, the focus/cursor should be
in the first input field of the form: Category code

To test:
* Add a new patron category in administration > patron categories
  - cursur is in no field
* Apply patch
* Add another new patron category
  - cursor is now in the first input field of the form: Category code

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Tomás Cohen Arazi (tcohen) 2022-09-07 20:46:02 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!