From e250bd1091452654959a681682e53fd110a23068 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 13 Apr 2015 20:56:43 -0700 Subject: [PATCH] Fix unwanted focusing on the submit button if you focus on the comment field too soon after entering the captcha. --- src/Posting/Captcha.v2.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Posting/Captcha.v2.coffee b/src/Posting/Captcha.v2.coffee index 1aad5b1d7..f090df6bc 100644 --- a/src/Posting/Captcha.v2.coffee +++ b/src/Posting/Captcha.v2.coffee @@ -155,11 +155,12 @@ Captcha.v2 = QR.nodes.status.focus() @reload() else + focus = d.activeElement?.nodeName is 'IFRAME' and d.activeElement.src?[...38] is 'https://www.google.com/recaptcha/api2/' if pasted @destroy() else @timeouts.destroy ?= setTimeout @destroy.bind(@), 3 * $.SECOND - QR.nodes.status.focus() + QR.nodes.status.focus() if focus QR.submit() if Conf['Post on Captcha Completion'] and !QR.cooldown.auto