Skip to content

Commit 100695d

Browse files
josbellclaude
andcommitted
fix: adjust FileUploadButton tooltip position to right with proper width
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 673bc90 commit 100695d

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

frontend/src/components/UI/Button/FileUploadButton/FileUploadButton.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ function FileUploadButton({
147147
{disabled && disabledTooltip ? (
148148
<Tooltip
149149
label={disabledTooltip}
150-
position="top"
151-
className="tooltip-centered"
150+
position="right"
151+
className="tooltip-centered tooltip-right-wide"
152152
>
153153
<div
154154
tabIndex={0}

frontend/src/index.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,24 @@ body {
3636
max-width: 300px;
3737
white-space: normal;
3838
}
39+
40+
/* ---------- Right-positioned tooltips need more width ---------- */
41+
/* Higher specificity selector to override USWDS default without !important */
42+
span.tooltip-right-wide .usa-tooltip__body.is-set,
43+
span.tooltip-right-wide .usa-tooltip__body.is-visible {
44+
max-width: 450px;
45+
min-width: 250px;
46+
}
47+
48+
/* ---------- Adjust vertical alignment for right-positioned tooltips ---------- */
49+
/* CSS variable for easy adjustment if needed */
50+
span.tooltip-right-wide {
51+
--tooltip-vertical-offset: -20px;
52+
}
53+
54+
/* USWDS applies inline styles dynamically (element.style.top), which have higher
55+
specificity than any CSS selector. !important is the only way to override them.
56+
The -20px offset centers the tooltip vertically with the FileUploadButton card. */
57+
span.tooltip-right-wide .usa-tooltip__body--right.is-visible {
58+
transform: translateY(var(--tooltip-vertical-offset)) !important;
59+
}

0 commit comments

Comments
 (0)