basaran / svelte-recaptcha-v2

Google reCAPTCHA v2 implementation for Svelte SPA, SSR and sveltekit static sites.
https://basaran.github.io/svelte-recaptcha-v2/demo
MIT License
42 stars 13 forks source link

on:ready never lauched if component dynamically rendered #17

Open nosovk opened 9 months ago

nosovk commented 9 months ago

If component wrapped into {if} block, then on:ready event never fired. Repl: https://svelte.dev/repl/95841074fe1648cf883b2cd5cffde2f1?version=4.2.2 The key in a repl could be wrong, but the problem exists in a wild life also. Currently, I've just added a button to manual launch execute, as in an example. But it would be nice to avoid an additional step, and subscribe to an event.

basaran commented 3 months ago

Hello, I am not using the component with svelte expressions, as I had noticed inconsistent behavior when I had tried to build the package with {#await}.

I will test your reproduction when I have some time this week and report back.