From dc169cf1ea2c4120add12c38178053129ed2c7fe 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 109f1679672d3..8565deb168596 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" )}}