-
Notifications
You must be signed in to change notification settings - Fork 15
proof of concept demo with iron-form #12
base: master
Are you sure you want to change the base?
Conversation
google-recaptcha.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling this _validate is confusing once support for form validation logic is added so I propose renaming it. Let me know if something else (maybe that doesn't even have the word validate in it -- maybe checkOptions?) would be better.
google-recaptcha.html
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder why you call toggle class in _getValidity method ?
a google-recaptcha element's _getValidity method now gets called when you submit an iron-form that contains it. Without this toggleClass call, the red border would not appear around an invalid recaptcha upon attempting to submit the form.
|
What about set pristine to false in _responseHandler and _expiredHandler. It can make sense to have visual rendering even if you havn't click on the submit button. |
|
I think you should remove class="foo" from template tag :) |
This is a first pass at demonstrating putting a required google-recaptcha element inside an iron-form. To accomplish this, I gave the google-recaptcha element the
Polymer.IronFormElementBehaviorandPolymer.IronValidatableBehaviorbehaviors and supporting logic.This may more properly belong in a separate element just for iron-forms (e.g.
iron-form-recaptcha) if you'd like to keepgoogle-recaptchaagnostic to the form implementation it's included in, but it seems there should be a generic way for thegoogle-recaptchaelement to advertise its validity state to any containing form implementations. Polymer developers please advise, and I will be happy to help with taking this from proof of concept to whatever you envision offering.