From 6bad0fb24f0a2549da42d3d143be9f355712e8b3 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 17 Mar 2023 02:25:04 +0800 Subject: [PATCH] Fix review comment context menu clipped bug (#23523) This is another regression of #22959 (the first regression has been fixed by the Image Diff fix) Close #23517 This is a quick fix. Luckily, there is no "dropdown menu" for image/csv view, so we could only add the "overflow-x: scroll" to the image/csv view. After fix: ![image](https://user-images.githubusercontent.com/2114189/225643575-9e964b4f-5543-4a69-86c2-2ffc8e40d9a6.png) ![image](https://user-images.githubusercontent.com/2114189/225643670-f0e575d0-f4af-41f4-b023-2d9ddb6462e9.png) Co-authored-by: KN4CK3R --- templates/repo/diff/box.tmpl | 3 ++- web_src/css/helpers.css | 1 + web_src/css/repository.css | 4 ---- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index e0c58896f..e04c27b5e 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -161,7 +161,8 @@ {{end}} {{if $showFileViewToggle}} -
+ {{/* for image or CSV, it can have a horizontal scroll bar, there won't be review comment context menu (position absolute) which would be clipped by "overflow" */}} +
{{if $isImage}} {{template "repo/diff/image_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead}} diff --git a/web_src/css/helpers.css b/web_src/css/helpers.css index 9e974b9ea..1c02de2d7 100644 --- a/web_src/css/helpers.css +++ b/web_src/css/helpers.css @@ -22,6 +22,7 @@ /* below class names match Tailwind CSS */ .gt-pointer-events-none { pointer-events: none !important; } .gt-relative { position: relative !important; } +.gt-overflow-x-scroll { overflow-x: scroll !important; } .gt-mono { font-family: var(--fonts-monospace) !important; diff --git a/web_src/css/repository.css b/web_src/css/repository.css index bebe3ff8f..d2040ec0a 100644 --- a/web_src/css/repository.css +++ b/web_src/css/repository.css @@ -3337,10 +3337,6 @@ td.blob-excerpt { min-width: 100px; } -.diff-file-body { - overflow-x: scroll; -} - .diff-stats-bar { display: inline-block; background-color: var(--color-red);