diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 0a1150f19..7c3288ff3 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -133,7 +133,10 @@ QR = focus: -> $.queueTask -> return unless QR.nodes - focus = d.activeElement and QR.nodes.el.contains d.activeElement + focus = d.activeElement and ( + QR.nodes.el.contains(d.activeElement) or + d.activeElement.nodeName is 'IFRAME' and /^https:\/\/www\.google\.com\/recaptcha\//.test(d.activeElement.src) + ) if $.hasClass(QR.nodes.el, 'autohide') and focus isnt $.hasClass(QR.nodes.el, 'focus') QR.captcha[if focus then 'setup' else 'destroy']() $[if focus then 'addClass' else 'rmClass'] QR.nodes.el, 'focus'