From ca6b6994a7b2af2dd617b2ddb8832d30aef0660c Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 30 Oct 2015 14:43:58 -0700 Subject: [PATCH] Prevent Recaptcha from keeping focus when popup dismissed. Best solution for now since we still have to support the outgoing version. When the outgoing version is gone, we may be able to remove the strict anti-scroll measures, and this will no longer be necessary. --- src/Posting/Captcha.v2.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Posting/Captcha.v2.coffee b/src/Posting/Captcha.v2.coffee index 6703c8dac..92929ba00 100644 --- a/src/Posting/Captcha.v2.coffee +++ b/src/Posting/Captcha.v2.coffee @@ -237,6 +237,9 @@ Captcha.v2 = if $ 'iframe[src^="https://www.google.com/recaptcha/api2/frame"]', node new MutationObserver(@fixBubble.bind(@, node)).observe node, attributes: true + # Prevent Recaptcha from keeping focus when popup dismissed. + if overlay = $ 'div[style*="position: fixed;"]', node + $.on overlay, 'click', -> $('#qr iframe')?.blur() fixBubble: (node) -> {bottom, right, width} = node.getBoundingClientRect()