diff --git a/4chan_x.user.js b/4chan_x.user.js index a7b06f0fc..335f00263 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -745,7 +745,7 @@ cb: { keydown: function(e) { var key, o, range, selEnd, selStart, ta, thread, valEnd, valMid, valStart, value, _ref, _ref2, _ref3; - if (((_ref = d.activeElement.nodeName) === 'TEXTAREA' || _ref === 'INPUT') && !e.altKey && !e.ctrlKey && !(e.keyCode === 27)) { + if (((_ref = e.target.nodeName) === 'TEXTAREA' || _ref === 'INPUT') && !e.altKey && !e.ctrlKey && !(e.keyCode === 27)) { return; } key = keybinds.cb.keyCode(e); @@ -765,7 +765,7 @@ } break; case keybinds.spoiler: - ta = d.activeElement; + ta = e.target; if (ta.nodeName !== 'TEXTAREA') { return; } diff --git a/script.coffee b/script.coffee index d970e3378..d78537801 100644 --- a/script.coffee +++ b/script.coffee @@ -537,7 +537,7 @@ keybinds = cb: keydown: (e) -> - return if d.activeElement.nodeName in ['TEXTAREA', 'INPUT'] and not e.altKey and not e.ctrlKey and not (e.keyCode is 27) + return if e.target.nodeName in ['TEXTAREA', 'INPUT'] and not e.altKey and not e.ctrlKey and not (e.keyCode is 27) key = keybinds.cb.keyCode e if e.altKey then key = 'alt+' + key if e.ctrlKey then key = 'ctrl+' + key @@ -550,7 +550,7 @@ keybinds = else if qr.el qr.close() when keybinds.spoiler - ta = d.activeElement + ta = e.target return unless ta.nodeName is 'TEXTAREA' value = ta.value