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

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

Issue 516403003: Focus the first input when adding a new Autofill cc or address (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/resources/options/autofill_edit_creditcard_overlay.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/autofill_edit_address_overlay.js
diff --git a/chrome/browser/resources/options/autofill_edit_address_overlay.js b/chrome/browser/resources/options/autofill_edit_address_overlay.js
index 9582ed23342b41a4925dde349e73769863a6786b..c26a647ff54f85b40db26fd9a901dcb920ca9a25 100644
--- a/chrome/browser/resources/options/autofill_edit_address_overlay.js
+++ b/chrome/browser/resources/options/autofill_edit_address_overlay.js
@@ -327,10 +327,16 @@ cr.define('options', function() {
/**
* Loads the address data from |address|, sets the input fields based on
* this data, and stores the GUID and language code of the address.
- * @param {!Object} address Lots of info about an address from the browser.
+ * @param {Object} address Lots of info about an address from the browser.
* @private
*/
loadAddress_: function(address) {
+ if (!address) {
arv (Not doing code reviews) 2014/09/02 17:01:04 A better solution would be to have another functio
Evan Stade 2014/09/02 18:41:17 Done.
+ // Adding a new address --- focus the first element.
+ this.pageDiv.querySelector('input').focus();
+ return;
+ }
+
this.rebuildInputFields_(address.components);
this.setInputFields_(address);
this.inputFieldChanged_();
« no previous file with comments | « no previous file | chrome/browser/resources/options/autofill_edit_creditcard_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698