Skip to content

Commit b189039

Browse files
wxiaoguangStelios Malathouras
authored and
Stelios Malathouras
committed
Fix the editor height in review box (go-gitea#19003)
Fix the height problem in go-gitea#18862 (comment) I have tested this fix. # Screenshots ### Min-height <img width="1138" alt="image" src="https://user-images.githubusercontent.com/2114189/156811831-93d4d31a-1b0a-4c4c-a7b4-fafc706133d6.png"> ### Max-height <img width="1126" alt="image" src="https://user-images.githubusercontent.com/2114189/156811889-10ae41de-c63b-45e7-9d89-21a1ed29e58b.png">
1 parent 316ba54 commit b189039

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

web_src/js/features/repo-issue.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,8 @@ export function initRepoPullRequestReview() {
462462
(async () => {
463463
// the editor's height is too large in some cases, and the panel cannot be scrolled with page now because there is `.repository .diff-detail-box.sticky { position: sticky; }`
464464
// the temporary solution is to make the editor's height smaller (about 4 lines). GitHub also only show 4 lines for default. We can improve the UI (including Dropzone area) in future
465-
await createCommentEasyMDE($reviewBox.find('textarea'), {minHeight: '80px', maxHeight: 'calc(100vh - 360px)'});
465+
// EasyMDE's options can not handle minHeight & maxHeight together correctly, we have to set max-height for .CodeMirror-scroll in CSS.
466+
await createCommentEasyMDE($reviewBox.find('textarea'), {minHeight: '80px'});
466467
initCompImagePaste($reviewBox);
467468
})();
468469
}

web_src/less/_review.less

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,13 @@ a.blob-excerpt:hover {
197197
color: #fff;
198198
}
199199

200+
// See the comment of createCommentEasyMDE() for the review editor
201+
// EasyMDE's options can not handle minHeight & maxHeight together correctly, we have to set minHeight in JS code
202+
#review-box .CodeMirror-scroll {
203+
min-height: 80px;
204+
max-height: calc(100vh - 360px);
205+
}
206+
200207
@media @mediaSm {
201208
#review-box > .menu {
202209
> .ui.segment {

0 commit comments

Comments
 (0)