From 0f265a2489bcdac6cf350a89eecb19ed78e133c1 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Mon, 31 Jul 2023 16:02:25 +0800 Subject: [PATCH] Don't autosize textarea in diff view (#26233) (#26244) Backport #26233 by @silverwind Resizing the comment editor can be a very expensive operation because it triggers page reflows, which on large PRs can take upwards of seconds to complete. Disable this mechanism on the diff page only where we know that the page can get large. Fixes https://github.com/go-gitea/gitea/issues/26201 for the textarea editor. I don't think this can be fixed for EasyMDE because as far as I can tell, it exposes no option to disable this resizing. Co-authored-by: silverwind --- templates/repo/diff/comment_form.tmpl | 1 + templates/shared/combomarkdowneditor.tmpl | 3 ++- web_src/js/features/comp/ComboMarkdownEditor.js | 7 +++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl index 109f167967..8565deb168 100644 --- a/templates/repo/diff/comment_form.tmpl +++ b/templates/repo/diff/comment_form.tmpl @@ -17,6 +17,7 @@ "TextareaName" "content" "TextareaPlaceholder" ($.locale.Tr "repo.diff.comment.placeholder") "DropzoneParentContainer" "form" + "DisableAutosize" "true" )}}