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 3fadeab5ae1240efba55fc4c0aeda24a1d5814c3..86aaae84aa536f775996e963402a9d6b783e822d 100644 |
--- a/chrome/browser/resources/options/autofill_options_list.js |
+++ b/chrome/browser/resources/options/autofill_options_list.js |
@@ -174,6 +174,9 @@ cr.define('options.autofillOptions', function() { |
if (this.input.value && |
this.list.dataModel.indexOf(this.input.value) == -1) { |
+ // 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.validateAndSave(i, 0, this.input.value); |
} else { |
this.input.value = ''; |