Index: third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js |
diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js |
index 9c9d1ec9f435edc5c29a3247539b00cc3d4dfda5..65083e9885e5cf5f2181480cb48a3c88006a9cc2 100644 |
--- a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js |
+++ b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js |
@@ -55,16 +55,19 @@ |
*/ |
setItemSelected: function(item, isSelected) { |
if (item != null) { |
- if (isSelected) { |
- this.selection.push(item); |
- } else { |
- var i = this.selection.indexOf(item); |
- if (i >= 0) { |
- this.selection.splice(i, 1); |
+ if (isSelected !== this.isSelected(item)) { |
+ // proceed to update selection only if requested state differs from current |
+ if (isSelected) { |
+ this.selection.push(item); |
+ } else { |
+ var i = this.selection.indexOf(item); |
+ if (i >= 0) { |
+ this.selection.splice(i, 1); |
+ } |
+ } |
+ if (this.selectCallback) { |
+ this.selectCallback(item, isSelected); |
} |
- } |
- if (this.selectCallback) { |
- this.selectCallback(item, isSelected); |
} |
} |
}, |