I'm having some trouble watching for changes to input validity in polymer 1.0. More precisely, an observer function that should fire on any changes to the bound 'invalid' property is not firing as I'd expect it to. For instance, the function may fire when the control first becomes invalid, but if becomes valid again, the observer function is not being triggered (invalid not becoming false?). In my current example, I happen to be utilizing Polymer 1.0's gold-email-input element as follows:
Extract from my custom element's local DOM template:
<paper-icon-item>
<iron-icon icon="social:person"></iron-icon>
<gold-email-input id="userEmail" bind-value="{{userEmail}}" required auto-validate invalid="{{invalidEmail}}" error-message="Invalid email address"></gold-email-input>
</paper-icon-item>
Extract from my custom element's script declaration:
properties: {
invalidEmail: {type: Boolean, observer: 'emailValidityChanged'}
}
emailValidityChanged: function(newVal, oldVal) {
console.log(this.nodeName + " emailValidityChanged observer fired\n");
}
I'm probably missing something straightforward here? I've also tried observing changes on the userEmail property, and then checking the state of this.$.userEmail.invalid within the observer function, to no avail. It does appear that the invalid property is not being reset when the entry becomes valid. Any suggestions? Maybe another approach altogether?