From aa723dea9b4e22d93a1df8f38ee572e923756614 Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 31 Jul 2023 00:11:15 +0200 Subject: [PATCH] Don't autosize textarea in diff view (#26233) 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: Giteabot --- 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 109f16796..8565deb16 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" )}}