From 108e7781eab8d926ebbea8e971751c0492d7c0a9 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 25 Dec 2022 01:21:52 +0200 Subject: [PATCH] reset text-area size after commenting --- files/assets/js/comments_v.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/assets/js/comments_v.js b/files/assets/js/comments_v.js index 89ae367c4..8c90e59f8 100644 --- a/files/assets/js/comments_v.js +++ b/files/assets/js/comments_v.js @@ -199,6 +199,7 @@ function comment_edit(id){ function postComment(fullname, hide){ const btn = document.getElementById('save-reply-to-'+fullname) + const textArea = document.getElementById('reply-form-body-'+fullname) btn.disabled = true btn.classList.add('disabled'); @@ -206,7 +207,7 @@ function postComment(fullname, hide){ form.append('formkey', formkey()); form.append('parent_fullname', fullname); - form.append('body', document.getElementById('reply-form-body-'+fullname).value); + form.append('body', textArea.value); try { for (const e of document.getElementById('file-upload-reply-'+fullname).files) @@ -243,6 +244,7 @@ function postComment(fullname, hide){ document.getElementById('charcount-'+fullname).innerHTML = '' document.getElementById('filename-show-reply-' + fullname).innerHTML = ''; document.getElementById('file-upload-reply-'+fullname).value = null; + autoExpand(textArea); } else { showToast(false, getMessageFromJsonData(false, data));