Skip to content

Commit 1019736

Browse files
wxiaoguangzeripath
authored andcommitted
Fix the editor height in review box (go-gitea#19003)
Backport go-gitea#19003 Fix the height problem in go-gitea#18862 (comment)
1 parent 45c836b commit 1019736

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

web_src/js/features/repo-issue.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ export function initRepoPullRequestReview() {
461461
(async () => {
462462
// 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; }`
463463
// 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
464-
await createCommentEasyMDE($reviewBox.find('textarea'), {minHeight: '80px', maxHeight: 'calc(100vh - 360px)'});
464+
// EasyMDE's options can not handle minHeight & maxHeight together correctly, we have to set max-height for .CodeMirror-scroll in CSS.
465+
await createCommentEasyMDE($reviewBox.find('textarea'), {minHeight: '80px'});
465466
initCompImagePaste($reviewBox);
466467
})();
467468
}

web_src/less/_review.less

+7
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)