Skip to content

Commit eee03ae

Browse files
jpraetzeripath
andauthored
Add scroll-margin-top to account for sticky header (#16269)
Fixes #16263 Co-authored-by: zeripath <[email protected]>
1 parent f533b5d commit eee03ae

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

web_src/js/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@ function initPullRequestReview() {
13431343
$(`#code-comments-${id}`).removeClass('hide');
13441344
$(`#code-preview-${id}`).removeClass('hide');
13451345
$(`#hide-outdated-${id}`).removeClass('hide');
1346-
$(window).scrollTop(commentDiv.offset().top);
1346+
commentDiv[0].scrollIntoView();
13471347
}
13481348
}
13491349
}

web_src/less/_review.less

+8
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,11 @@ a.blob-excerpt:hover {
173173
.review-box > .segment {
174174
border: none !important;
175175
}
176+
177+
.pull.files.diff [id] {
178+
scroll-margin-top: 99px;
179+
180+
@media @mediaMdAndDown {
181+
scroll-margin-top: 130px;
182+
}
183+
}

0 commit comments

Comments
 (0)