Hardcode the width of "Press C to comment" tooltip
Ib1a05ce8d introduced the ability to create multiline tooltips. The
purpose of the change was to allow code-owners plugin to have more
detailed owners tooltip for the files.
Unfortunately the overriding of `white-space`, breaks the width
calculation for the "Press C to comment tooltip". For the `position:
absolute` elements the `width:auto`, `width:max-content` and
`width:min-content` doesn't achieve the desired result of letting the
tooltip be as large as needed.
In Ibffb432ed the width was set to 100% instead, which fixed the issue,
but made the horizontal scrollbars appear. So in this change we hardcode
the appropriate width for the "Press C to comment" message, since we
know exactly how long it is.
Google-Bug-Id: b/302129659
Release-Notes: skip
Change-Id: I63634ac4c2e2d8c5e6e72564779d4a6c1b3bb046
diff --git a/polygerrit-ui/app/embed/diff/gr-selection-action-box/gr-selection-action-box.ts b/polygerrit-ui/app/embed/diff/gr-selection-action-box/gr-selection-action-box.ts
index b95a450..cd10f4d 100644
--- a/polygerrit-ui/app/embed/diff/gr-selection-action-box/gr-selection-action-box.ts
+++ b/polygerrit-ui/app/embed/diff/gr-selection-action-box/gr-selection-action-box.ts
@@ -48,7 +48,7 @@
cursor: pointer;
font-family: var(--font-family);
position: absolute;
- width: 100%;
+ width: 20ch;
}
gr-tooltip[invisible] {
visibility: hidden;