Bug 27195

Summary: Set focus for cursor to city input box when creating new cities
Product: Koha Reporter: Barbara Johnson <barbara.johnson>
Component: TemplatesAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Kyle M Hall <kyle>
Severity: enhancement    
Priority: P5 - low CC: ellawipatene, gmcharlt, jonathan.druart, katrin.fischer, kyle
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Bug Depends on:    
Bug Blocks: 31411    
Attachments: bug 27195:Set focus for cursor to city input box when creating new cities
Bug 27195: Set focus for cursor to city input box when creating new cities (Before downloading the patch) 1. Go to administration 2. Go to cities 3. Click on add new city 4. See if the cursor automatically focuses to the first city con
Bug 27195: Set focus for cursor to city input bo when creating new cities
Bug 27195: Set focus for cursor to city input box when creating new cities
Bug 27195: Set focus for cursor to city input box when creating new cities
Bug 27195: Set focus for cursor to city input box when creating new cities
Bug 27195: Set focus on first input when adding a new city
Bug 27195: Set focus on first input when adding a new city
Bug 27195: Set focus on first input when adding a new city

Description Barbara Johnson 2020-12-10 16:18:26 UTC
When adding a new city on cities.pl you have to click in the city 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 city input box so that you could just begin typing and eliminate an extra click.
Comment 1 Katrin Fischer 2021-01-11 22:05:46 UTC
There are quite a few similar bugs with recent patches that can be used to see how this can be done. Look for "focus", an example would be bug 27192.
Comment 2 Aleisha Amohia 2021-01-18 02:47:06 UTC
*** Bug 27456 has been marked as a duplicate of this bug. ***
Comment 3 Ella 2021-01-19 00:59:55 UTC
Created attachment 115264 [details] [review]
bug 27195:Set focus for cursor to city input box when creating new cities

(Before downloading the patch)
    1. Go to administration
    2. Go to cities
    3. Click on add new city
    4. See if the cursor automatically focuses to the first city
    container (It shouldn't).
    5. Apply patch
    6. Repeat steps 1-4
    7. If the cursor automatically focuses in the first city container,
    the patch has worked!

Sponsored-by: Catalyst IT
Comment 4 Jonathan Druart 2021-01-19 09:03:48 UTC
Hello Ella,

The commit message must start with "Bug 27195: ".
Also you should try and avoid adding empty lines as it could cause unnecessary conflicts with other patches.
Comment 5 Ella 2021-01-19 20:29:08 UTC
Created attachment 115350 [details] [review]
Bug 27195: Set focus for cursor to city input box when creating new cities (Before downloading the patch)     1. Go to administration     2. Go to cities     3. Click on add new city     4. See if the cursor automatically focuses to the first city     con

Sponsored-by: Catalyst IT
Comment 6 Ella 2021-01-19 20:43:07 UTC
Created attachment 115355 [details] [review]
Bug 27195: Set focus for cursor to city input bo when creating new cities

Was removing an empty line in the patch

(For testing, do the same tests as above)
Comment 7 Ella 2021-01-19 20:52:34 UTC
Created attachment 115360 [details] [review]
Bug 27195: Set focus for cursor to city input box when creating new cities

(Before downloading the patch)
    1. Go to administration
    2. Go to cities
    3. Click on add new city
    4. See if the cursor automatically focuses to the first city
    container (It shouldn't).
    5. Apply patch
    6. Repeat steps 1-4
    7. If the cursor automatically focuses in the first city container,
    the patch has worked!

Sponsored-by: Catalyst IT
Comment 8 PTFS Europe Sandboxes 2021-01-19 21:42:52 UTC
Created attachment 115365 [details] [review]
Bug 27195: Set focus for cursor to city input box when creating new cities

(Before downloading the patch)
    1. Go to administration
    2. Go to cities
    3. Click on add new city
    4. See if the cursor automatically focuses to the first city
    container (It shouldn't).
    5. Apply patch
    6. Repeat steps 1-4
    7. If the cursor automatically focuses in the first city container,
    the patch has worked!

Sponsored-by: Catalyst IT

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 9 Kyle M Hall 2021-01-21 19:54:56 UTC
Created attachment 115615 [details] [review]
Bug 27195: Set focus for cursor to city input box when creating new cities

(Before downloading the patch)
    1. Go to administration
    2. Go to cities
    3. Click on add new city
    4. See if the cursor automatically focuses to the first city
    container (It shouldn't).
    5. Apply patch
    6. Repeat steps 1-4
    7. If the cursor automatically focuses in the first city container,
    the patch has worked!

Sponsored-by: Catalyst IT

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Jonathan Druart 2021-01-22 13:09:15 UTC
Focus must be put using the "focus" class instead.
Comment 11 Katrin Fischer 2022-08-18 19:59:17 UTC
Created attachment 139418 [details] [review]
Bug 27195: Set focus on first input when adding a new city

When adding a new city, the focus/cursor should be
in the first input field of the form: City

To test:
* Add a new city in administration > cities
  - cursur is in no field
* Apply patch
* Add another new city
  - cursor is now in the first input field of the form: City

https://bugs.koha-community.org/show_bug.cgi?id=27193
Comment 12 ByWater Sandboxes 2022-08-18 20:37:44 UTC
Created attachment 139422 [details] [review]
Bug 27195: Set focus on first input when adding a new city

When adding a new city, the focus/cursor should be
in the first input field of the form: City

To test:
* Add a new city in administration > cities
  - cursur is in no field
* Apply patch
* Add another new city
  - cursor is now in the first input field of the form: City

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

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Comment 13 Kyle M Hall 2022-09-16 18:04:15 UTC
Created attachment 140732 [details] [review]
Bug 27195: Set focus on first input when adding a new city

When adding a new city, the focus/cursor should be
in the first input field of the form: City

To test:
* Add a new city in administration > cities
  - cursur is in no field
* Apply patch
* Add another new city
  - cursor is now in the first input field of the form: City

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 14 Tomás Cohen Arazi 2022-09-16 20:00:59 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!