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

Unified Diff: chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js

Issue 2676573003: Copy item so dialog won't update model on cancel. (Closed)
Patch Set: feedback Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
diff --git a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
index dfd4bc7c9c47f2855e7a75e76afff08d9c84d7d2..5d8c75dba9d9f2a047a5d12ccf1a1c390c5a2ec4 100644
--- a/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
+++ b/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
@@ -62,8 +62,10 @@
*/
onAddressMenuTap_: function(e) {
var menuEvent = /** @type {!{model: !{item: !Object}}} */(e);
+
+ // Copy item so dialog won't update model on cancel.
this.activeAddress = /** @type {!chrome.autofillPrivate.AddressEntry} */(
- menuEvent.model.item);
+ Object.assign({}, menuEvent.model.item));
var dotsButton = /** @type {!HTMLElement} */ (Polymer.dom(e).localTarget);
/** @type {!CrActionMenuElement} */ (
@@ -117,9 +119,11 @@
*/
onCreditCardMenuTap_: function(e) {
var menuEvent = /** @type {!{model: !{item: !Object}}} */(e);
+
+ // Copy item so dialog won't update model on cancel.
this.activeCreditCard =
/** @type {!chrome.autofillPrivate.CreditCardEntry} */(
- menuEvent.model.item);
+ Object.assign({}, menuEvent.model.item));
var dotsButton = /** @type {!HTMLElement} */ (Polymer.dom(e).localTarget);
/** @type {!CrActionMenuElement} */ (
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698