When adding a new item type on itemtypes.pl you have to click in the item type 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 item type input box so that you could just begin typing and eliminate an extra click.
Created attachment 114968 [details] [review] Bug 27192: Automatically set focus to the item type input box When adding a new item type, you have to click inside the "Ιtem type:" input box before you can start entering text. This patch fixes that by adding the "focus" class to the relevant <input> element so that cursor focus is set when the page loads. Test plan: 1) Try to add a new item type: notice how you have to manually click inside the "Item type:" input box before you start typing. 2) Apply this patch. 3) Repeat step 1) -- this time the "Item type:" input box should gain focus automatically.
I based my patch on Owen Leonard's work in Bug 26694 -- Thank you Owen!
Created attachment 115105 [details] [review] Bug 27192: Automatically set focus to the item type input box When adding a new item type, you have to click inside the "Ιtem type:" input box before you can start entering text. This patch fixes that by adding the "focus" class to the relevant <input> element so that cursor focus is set when the page loads. Test plan: 1) Try to add a new item type: notice how you have to manually click inside the "Item type:" input box before you start typing. 2) Apply this patch. 3) Repeat step 1) -- this time the "Item type:" input box should gain focus automatically. Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Created attachment 115225 [details] [review] Bug 27192: Automatically set focus to the item type input box When adding a new item type, you have to click inside the "Ιtem type:" input box before you can start entering text. This patch fixes that by adding the "focus" class to the relevant <input> element so that cursor focus is set when the page loads. Test plan: 1) Try to add a new item type: notice how you have to manually click inside the "Item type:" input box before you start typing. 2) Apply this patch. 3) Repeat step 1) -- this time the "Item type:" input box should gain focus automatically. Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 115254 [details] [review] Bug 27192: Automatically set focus to the item type input box When adding a new item type, you have to click inside the "Ιtem type:" input box before you can start entering text. This patch fixes that by adding the "focus" class to the relevant <input> element so that cursor focus is set when the page loads. Test plan: 1) Try to add a new item type: notice how you have to manually click inside the "Item type:" input box before you start typing. 2) Apply this patch. 3) Repeat step 1) -- this time the "Item type:" input box should gain focus automatically. Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Amy King <amyking386@gmail.com>
Created attachment 115256 [details] [review] Bug 27192: Automatically set focus to the item type input box When adding a new item type, you have to click inside the "Ιtem type:" input box before you can start entering text. This patch fixes that by adding the "focus" class to the relevant <input> element so that cursor focus is set when the page loads. Test plan: 1) Try to add a new item type: notice how you have to manually click inside the "Item type:" input box before you start typing. 2) Apply this patch. 3) Repeat step 1) -- this time the "Item type:" input box should gain focus automatically. Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Thx Amy :)
Shouldn't it be implemented for the "edit" action as well? Focus would be on "Parent item type".
Owen answered me on IRC: oleonard> The suggestion is logical, but from the point of view of a sighted user, focus on a <select> is much less obvious. There is also the question of whether the user really wants to edit all fields starting from the beginning, or whether they're looking for a particular field to change. oleonard> My inclination is to leave it as it is for the edit action.
Pushed to master for 21.05, thanks to everybody involved!
Super small enhancement, I choose to backport. Pushed to 20.11.x for 20.11.03
Following Frido, backporting to 20.05.x for 20.05.09
Backported: Pushed to 19.11.x branch for 19.11.15