Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4231)

Unified Diff: chrome/browser/resources/options/autofill_options_list.js

Issue 819193003: Fix list focus after tab key in chrome://settings/autofillEditAddress page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove a couple log statements and add a comment. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/options/autofill_options_list.js
diff --git a/chrome/browser/resources/options/autofill_options_list.js b/chrome/browser/resources/options/autofill_options_list.js
index 902fdcd3df31429e9a7f9fb7713a91367bc0a583..e62ff0995646a1033e7a665f47cb35ef1a7eee8e 100644
--- a/chrome/browser/resources/options/autofill_options_list.js
+++ b/chrome/browser/resources/options/autofill_options_list.js
@@ -210,17 +210,23 @@ cr.define('options.autofillOptions', function() {
if (this.isPlaceholder) {
// It is important that updateIndex is done before validateAndSave.
// Otherwise we can not be sure about AddRow index.
- this.list.dataModel.updateIndex(i);
+ this.list.ignoreChangeEvents(function() {
+ this.list.dataModel.updateIndex(i);
+ }.bind(this));
this.list.validateAndSave(i, 0, value);
} else {
this.list.validateAndSave(i, 1, value);
}
} else {
// Reject empty values and duplicates.
- if (!this.isPlaceholder)
- this.list.dataModel.splice(i, 1);
- else
+ if (!this.isPlaceholder) {
+ this.list.ignoreChangeEvents(function() {
+ this.list.dataModel.splice(i, 1);
+ }.bind(this));
+ this.list.selectIndexWithoutFocusing(i);
+ } else {
this.clearValue_();
+ }
}
},
};
@@ -444,7 +450,10 @@ cr.define('options.autofillOptions', function() {
* @param {string} value The value of the item to insert.
*/
validateAndSave: function(index, remove, value) {
- this.dataModel.splice(index, remove, value);
+ this.ignoreChangeEvents(function() {
+ this.dataModel.splice(index, remove, value);
+ }.bind(this));
+ this.selectIndexWithoutFocusing(index);
},
};
@@ -515,8 +524,6 @@ cr.define('options.autofillOptions', function() {
while (this.validationPromiseResolvers_.length) {
this.validationPromiseResolvers_.pop()();
}
- // List has been repopulated. Focus the placeholder.
- this.focusPlaceholder();
}
},
« no previous file with comments | « chrome/browser/autofill/autofill_uitest_util.cc ('k') | chrome/browser/resources/options/inline_editable_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698