From 7c603e5e27f20dc9983df3da8fc3259ad576d0aa Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 13 Feb 2016 23:47:49 -0800 Subject: [PATCH] Don't steal focus from privacy/terms links, but take them out of the tab order. They should now be keyboard-reachable by searching for the text, but won't get in the way when tabbing to the submit button on various forms. --- src/Posting/Captcha.fixes.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Posting/Captcha.fixes.coffee b/src/Posting/Captcha.fixes.coffee index 36e52577e..4fe7adec6 100644 --- a/src/Posting/Captcha.fixes.coffee +++ b/src/Posting/Captcha.fixes.coffee @@ -51,12 +51,17 @@ Captcha.fixes = initMain: -> $.onExists d.body, '#recaptcha-anchor', (checkbox) -> focus = -> - if d.hasFocus() and d.activeElement isnt checkbox + if d.hasFocus() and d.activeElement in [d.documentElement, d.body] checkbox.focus() focus() $.on window, 'focus', -> $.queueTask focus + # Remove Privacy and Terms links from tab order. + for a in $$ '.rc-anchor-pt a' + a.tabIndex = -1 + return + initPopup: -> $.addStyle @css @fixImages()