Commit dd6f91cd authored by Douwe Maan's avatar Douwe Maan

Trigger autosize on the textarea after pasting

parent b6ac5332
...@@ -185,6 +185,14 @@ ...@@ -185,6 +185,14 @@
target.value = newText; target.value = newText;
target.selectionStart = target.selectionEnd = selectionStart + text.length; target.selectionStart = target.selectionEnd = selectionStart + text.length;
// Trigger autosave
$(target).trigger('input');
// Trigger autosize
var event = document.createEvent('Event');
event.initEvent('autosize:update', true, false);
target.dispatchEvent(event);
}; };
w.gl.utils.nodeMatchesSelector = (node, selector) => { w.gl.utils.nodeMatchesSelector = (node, selector) => {
......
...@@ -61,8 +61,15 @@ ...@@ -61,8 +61,15 @@
replyField.val(function(_, current) { replyField.val(function(_, current) {
return current + separator + quote.join('') + "\n"; return current + separator + quote.join('') + "\n";
}); });
// Trigger autosave for the added text
// Trigger autosave
replyField.trigger('input'); replyField.trigger('input');
// Trigger autosize
var event = document.createEvent('Event');
event.initEvent('autosize:update', true, false);
replyField.get(0).dispatchEvent(event);
// Focus the input field // Focus the input field
return replyField.focus(); return replyField.focus();
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment