DescriptionFix two focus regressions in chrome://settings/autofillEditAddress page.
Sets list item selection and focus correctly when edit is committed in
name/phone/email lists on chrome://settings/autofillEditAddress page.
"Correctly" means the just-edited list item remains the selected item in
the list, and the next focusable element after the list gets focus. The
list no longer has focus, but if the user gives focus back to the list
using tab/shift+tab then the just-edited list item will receive focus.
This is different than the default InlineEditableItemList behavior
because most addresses will have only a single name/phone/email, so it's
better to move to the next field type rather than to the "Add another"
placeholder of the same field type. I tried to keep the changes
contained to autofill_options_list.js because that's the only page that
needs this focus behavior. Generalizing the code into
inline_editable_list.js might result in more regressions to fix
elsewhere.
The fix implementation is to disable list events during list operations
in autofillOptions.ValuesListItem.onEditCommitted_, so that focus is not
returned back to the list that was just tabbed away from. Then
onEditCommitted_ calls the new
InlineEditableItemList.SelectIndexWithoutFocusing method to set the
selected list item without setting focus back to the list.
Same fix for both regressions.
https://crbug.com/440760 was caused by me.
https://crbug.com/443491 was from a CL by hcarmona@, but we agreed I
should take it because I'm more familiar with this code.
BUG=440760, 443491
Committed: https://crrev.com/10a45b9048e77944987d387b0eff3b5fcfd7a0bc
Cr-Commit-Position: refs/heads/master@{#314675}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Address reviewer comments on patch set 1. #Patch Set 3 : Add tests. #
Total comments: 3
Patch Set 4 : Add wrapper for disabling events. #
Total comments: 11
Patch Set 5 : Address reviewer comments on patch set 4. #
Total comments: 20
Patch Set 6 : Address reviewer comments on patch set 5. #
Total comments: 13
Patch Set 7 : Fix nits in patch set 6. #Patch Set 8 : Make UI test work for phone list. #
Total comments: 9
Patch Set 9 : Move WindowedPersonalDataManagerObserver entirely into cc file. #
Total comments: 4
Patch Set 10 : Rename WindowedPersonalDataManagerObserver and add TODOs. #Patch Set 11 : Rebase. #Patch Set 12 : Temp try test: press shift+tab twice. #Patch Set 13 : Temp try test: call CreateTestProfile() for all tests. #Patch Set 14 : Temp try test: revert b440646 and b444507. Add log message at start of 'add' and 'edit' parts of te… #Patch Set 15 : Temp try test: add ListenForFirstItemSelected. #Patch Set 16 : Temp try test: re-apply b440646, b444507 and 'press shift+tab twice' fix. #Patch Set 17 : Temp try test: add ListenForCommitEdit. #Patch Set 18 : Temp try test: disable tests for TOOLKIT_VIEWS. #
Total comments: 1
Patch Set 19 : Add skip_ok_button for Windows and ChromeOS. #
Total comments: 4
Patch Set 20 : Remove a couple log statements and add a comment. #Messages
Total messages: 44 (13 generated)
|