diff --git a/4chan_x.user.js b/4chan_x.user.js index 1cc846196..54f5f836e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1261,7 +1261,8 @@ caretPos = ta.selectionStart; ta.value = ta.value.slice(0, caretPos) + text + ta.value.slice(ta.selectionEnd, ta.value.length); ta.focus(); - return ta.selectionEnd = ta.selectionStart = caretPos + text.length; + ta.selectionEnd = ta.selectionStart = caretPos + text.length; + return qr.selected.com = ta.value; }, fileDrop: function(e) { if (/TEXTAREA|INPUT/.test(e.target.nodeName)) return; diff --git a/script.coffee b/script.coffee index 0af547bb5..88a2f104a 100644 --- a/script.coffee +++ b/script.coffee @@ -931,6 +931,9 @@ qr = #move the caret to the end of the new quote ta.selectionEnd = ta.selectionStart = caretPos + text.length + # onchange event isn't triggered, save value + qr.selected.com = ta.value + fileDrop: (e) -> return if /TEXTAREA|INPUT/.test e.target.nodeName e.preventDefault()