From 86e4d8a385868b6f500384934cfcf9835f6b69b1 Mon Sep 17 00:00:00 2001 From: Jochen Rauschenbusch Date: Thu, 26 May 2016 20:00:27 +0200 Subject: [PATCH] Fix for reCaptcha fallback mode Workaround for the folling issues: https://github.com/VividCortex/angular-recaptcha/issues/46 https://github.com/VividCortex/angular-recaptcha/issues/137 --- src/directive.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/directive.js b/src/directive.js index 66b81ea..1e6c580 100644 --- a/src/directive.js +++ b/src/directive.js @@ -60,6 +60,12 @@ scope.$on('$destroy', destroy); + elm.find('textArea').on('paste', function(evt) { + $timeout(function() { + callback(evt.target.value); + }); + }); + scope.$on('reCaptchaReset', function(event, resetWidgetId){ if(ng.isUndefined(resetWidgetId) || widgetId === resetWidgetId){ scope.response = ""; @@ -77,6 +83,7 @@ if (ctrl) { // reset the validity of the form if we were removed ctrl.$setValidity('recaptcha', null); + elm.find('textArea').off('paste'); } cleanup();