Zecat / google-recaptcha

A Polymer element for google recaptcha V2 and invisible (Polymer 1.9 - 2.x)
https://www.webcomponents.org/element/Zecat/google-recaptcha
5 stars 2 forks source link

Refit on resize #3

Open alejost848 opened 6 years ago

alejost848 commented 6 years ago

I'm trying to implement google-recaptcha in a contact form, but I'm having problems trying to refit the element on scroll.

In the README it says that:

The container is refit every time the user scroll or the <google-recaptcha> is notified of resize.

If I scroll, the element refits properly, but I haven't found a way to make it work on resize. I tried adding an iron-resize listener on my element and then calling notifyResize() or refit() on google-recaptcha but that didn't work.

Can you give an example of how do you notify <google-recaptcha> of a resize?

Thanks.

alejost848 commented 6 years ago

OK, I got it. I had to reference the container directly using this.$.recaptcha.container and then call refit() on it.

I think it would be a nice addition to have an example in the demo. I can create a pull request if needed.