| Index: third_party/polymer/v1_0/components-chromium/iron-checked-element-behavior/iron-checked-element-behavior-extracted.js
|
| diff --git a/third_party/polymer/v1_0/components-chromium/iron-checked-element-behavior/iron-checked-element-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-checked-element-behavior/iron-checked-element-behavior-extracted.js
|
| index 17cc73d48b40c5dc12cc75b96f88a1d24d7c12b5..101506eed2223a0721775fecbb169e151e047dca 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/iron-checked-element-behavior/iron-checked-element-behavior-extracted.js
|
| +++ b/third_party/polymer/v1_0/components-chromium/iron-checked-element-behavior/iron-checked-element-behavior-extracted.js
|
| @@ -40,7 +40,8 @@
|
| /* Overriden from Polymer.IronFormElementBehavior */
|
| value: {
|
| type: String,
|
| - value: ''
|
| + value: 'on',
|
| + observer: '_valueChanged'
|
| }
|
| },
|
|
|
| @@ -48,6 +49,13 @@
|
| '_requiredChanged(required)'
|
| ],
|
|
|
| + created: function() {
|
| + // Used by `iron-form` to handle the case that an element with this behavior
|
| + // doesn't have a role of 'checkbox' or 'radio', but should still only be
|
| + // included when the form is serialized if `this.checked === true`.
|
| + this._hasIronCheckedElementBehavior = true;
|
| + },
|
| +
|
| /**
|
| * Returns false if the element is required and not checked, and true otherwise.
|
| * @return {boolean} true if `required` is false, or if `required` and `checked` are both true.
|
| @@ -68,15 +76,20 @@
|
| },
|
|
|
| /**
|
| - * Update the element's value when checked.
|
| + * Fire `iron-changed` when the checked state changes.
|
| */
|
| _checkedChanged: function() {
|
| this.active = this.checked;
|
| - // Unless the user has specified a value, a checked element has the
|
| - // default value "on" when checked.
|
| - if (this.value === '')
|
| - this.value = this.checked ? 'on' : '';
|
| this.fire('iron-change');
|
| + },
|
| +
|
| + /**
|
| + * Reset value to 'on' if it is set to `undefined`.
|
| + */
|
| + _valueChanged: function() {
|
| + if (this.value === undefined || this.value === null) {
|
| + this.value = 'on';
|
| + }
|
| }
|
| };
|
|
|
|
|