File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export default class ReCAPTCHA extends React.Component {
66 super ( ) ;
77 this . handleExpired = this . handleExpired . bind ( this ) ;
88 this . handleErrored = this . handleErrored . bind ( this ) ;
9+ this . handleChange = this . handleChange . bind ( this ) ;
910 this . handleRecaptchaRef = this . handleRecaptchaRef . bind ( this ) ;
1011 }
1112
@@ -42,21 +43,25 @@ export default class ReCAPTCHA extends React.Component {
4243 handleExpired ( ) {
4344 if ( this . props . onExpired ) {
4445 this . props . onExpired ( ) ;
45- } else if ( this . props . onChange ) {
46- this . props . onChange ( null ) ;
46+ } else {
47+ this . handleChange ( null ) ;
4748 }
4849 }
4950
5051 handleErrored ( ) {
5152 if ( this . props . onErrored ) this . props . onErrored ( ) ;
5253 }
5354
55+ handleChange ( token ) {
56+ if ( this . props . onChange ) this . props . onChange ( token ) ;
57+ }
58+
5459 explicitRender ( ) {
5560 if ( this . props . grecaptcha && this . props . grecaptcha . render && this . _widgetId === undefined ) {
5661 const wrapper = document . createElement ( "div" ) ;
5762 this . _widgetId = this . props . grecaptcha . render ( wrapper , {
5863 sitekey : this . props . sitekey ,
59- callback : this . props . onChange ,
64+ callback : this . handleChange ,
6065 theme : this . props . theme ,
6166 type : this . props . type ,
6267 tabindex : this . props . tabindex ,
You can’t perform that action at this time.
0 commit comments