From cbf5dffaf29c1e871342c15478b33e9229a7f9d2 Mon Sep 17 00:00:00 2001
From: zeripath <art27@cantab.net>
Date: Thu, 30 Apr 2020 02:59:47 +0100
Subject: [PATCH] Fix submit review form (#11252)

* Fix submit review form

Signed-off-by: Andrew Thornton <art27@cantab.net>

* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>

* try something different

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Update web_src/less/_base.less

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
---
 templates/repo/diff/new_review.tmpl |  2 +-
 web_src/less/_base.less             | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl
index 4981c9ef48..3c341eaf0d 100644
--- a/templates/repo/diff/new_review.tmpl
+++ b/templates/repo/diff/new_review.tmpl
@@ -3,7 +3,7 @@
 		<span class="text">{{.i18n.Tr "repo.diff.review"}}</span>
 		<i class="dropdown icon"></i>
 	</div>
-	<div class="menu">
+	<div class="menu review-box">
 		<div class="ui clearing segment">
 			<form class="ui form" action="{{.Link}}/reviews/submit" method="post">
 			{{.CsrfTokenHtml}}
diff --git a/web_src/less/_base.less b/web_src/less/_base.less
index d2b1b6e66b..6241ad5072 100644
--- a/web_src/less/_base.less
+++ b/web_src/less/_base.less
@@ -1231,12 +1231,21 @@ i.icon.centerlock {
 
 /* limit width of all direct dropdown menu children */
 /* https://github.com/go-gitea/gitea/pull/10835 */
-.dropdown:not(.selection) > .menu > * {
+.dropdown:not(.selection) > .menu:not(.review-box) > * {
     max-width: 300px;
     overflow-x: hidden;
     text-overflow: ellipsis;
 }
 
+.dropdown:not(.selection) > .menu.review-box > * {
+    @media only screen and (max-height: 700px) {
+        .CodeMirror,
+        .CodeMirror-scroll {
+            min-height: 100px;
+        }
+    }
+}
+
 .text-label {
     display: inline-flex !important;
     align-items: center !important;