If you have saved an existing item or added a new one, it would be nice to have the focus in the search box. In other cases, at the start of adding or editing an item, it would be good to have focus in the item fields already. This patch sets the focus in the second case on the first item input field, since focus on the first select (combo box) does not show up.
Created attachment 57257 [details] [review] Bug 17566: Change initial focus in item editor depending on last action If you have saved an existing item or added a new one, it would be nice to have the focus in the search box. In other cases, at the start of adding or editing an item, it would be good to have focus in the item fields already. This patch sets the focus in the second case on the first item input field, since focus on the first select (combo box) does not show up. Test plan: [1] From staff detail view, click Edit items in the menu. Focus should go to item fields. [2] Save this new item. Focus on search box? [3] Click to edit this item. Focus on item fields? [4] Save again. Focus on search box again? [5] Delete this item. Focus on search box again?
Created attachment 57259 [details] [review] Bug 17566: Change initial focus in item editor depending on last action If you have saved an existing item or added a new one, it would be nice to have the focus in the search box. In other cases, at the start of adding or editing an item, it would be good to have focus in the item fields already. This patch sets the focus in the second case on the first item input field, since focus on the first select (combo box) does not show up. Test plan: [1] From staff detail view, click Edit items in the menu. Focus should go to item fields. [2] Save this new item. Focus on search box? [3] Click to edit this item. Focus on item fields? [4] Save again. Focus on search box again? [5] Delete this item. Focus on search box again?
Created attachment 57281 [details] [review] [SIGNED-OFF] Bug 17566: Change initial focus in item editor depending on last action If you have saved an existing item or added a new one, it would be nice to have the focus in the search box. In other cases, at the start of adding or editing an item, it would be good to have focus in the item fields already. This patch sets the focus in the second case on the first item input field, since focus on the first select (combo box) does not show up. Test plan: [1] From staff detail view, click Edit items in the menu. Focus should go to item fields. [2] Save this new item. Focus on search box? [3] Click to edit this item. Focus on item fields? [4] Save again. Focus on search box again? [5] Delete this item. Focus on search box again? Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
I don't really like that, especially because it does not work with select. It's weird to select the 4th element (in my case) of the add item form. I'd like to get cataloguer specialist point of views.
Created attachment 57881 [details] [review] Bug 17566: [Follow-up] Initial focus on first select or input Previous patch just set the focus to the first input, because the focus on the first select does not show up in some browsers (incl FF). Joubu complained about that, which is not unreasonable :) This patch puts the focus on the first subfield (under conditions described earlier). We do not solve all browser problems here, but it still is an improvement compared to the original focus. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(In reply to Jonathan Druart from comment #4) > I don't really like that, especially because it does not work with select. > It's weird to select the 4th element (in my case) of the add item form. > I'd like to get cataloguer specialist point of views. Your concern should be dealt with in the second patch, although focus and various browsers are not my favorite topic ;)
With the second patch, I don't see the focus at all. It seems to be on the first select because when I tab it selects the second select. But I cannot interact with it (select an option).
(In reply to Jonathan Druart from comment #7) > With the second patch, I don't see the focus at all. > It seems to be on the first select because when I tab it selects the second > select. But I cannot interact with it (select an option). Thats a browser problem that I cannot solve. The focus is there. See commit message.
Changing status to BLOCKED Anyone have a clue how to make this focus visible?
If we want to put the focus on the first select2-styled <select> I think we have to trigger it to open: https://select2.github.io/examples.html#programmatic However, I wonder whether this bug makes too many assumptions about how catalogers want to work. In our framework the first subfield is "Withdrawn status," and that's almost never the first field the catalogers will want to change. The focus returns to the search form at the top after I have edited an item, but what if I wanted to edit another item next? I worry that this patch assumes a workflow which is not universal enough to make it appropriate.
(In reply to Owen Leonard from comment #10) > If we want to put the focus on the first select2-styled <select> I think we > have to trigger it to open: > > https://select2.github.io/examples.html#programmatic Thanks for your feedback. Could not get it working rightaway.. Maybe for this reason: http://stackoverflow.com/questions/2562723/javascript-focus-and-select-not-working-in-ff Not spending too much time on it now. > However, I wonder whether this bug makes too many assumptions about how > catalogers want to work. In our framework the first subfield is "Withdrawn > status," and that's almost never the first field the catalogers will want to > change. > > The focus returns to the search form at the top after I have edited an item, > but what if I wanted to edit another item next? > > I worry that this patch assumes a workflow which is not universal enough to > make it appropriate. Yeah. You made a QAer happy :) But I must of course admit that this patch is in the 'foggy' category.