Fleet UI: Tooltip shows dynamically on truncated text only (#20420)

This commit is contained in:
RachelElysia
2024-07-15 12:08:26 -04:00
committed by GitHub
parent bccb80d914
commit fb2778c9b3
12 changed files with 58 additions and 28 deletions
@@ -1,12 +1,12 @@
.query-frequency-indicator {
width: 90px;
display: flex;
align-items: center;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
.icon {
vertical-align: middle;
padding-right: $pad-small;
}
}
@@ -49,7 +49,7 @@ const TooltipTruncatedTextCell = ({
const isDefaultValue = value === DEFAULT_EMPTY_CELL_VALUE;
return (
<div ref={ref} className={classNames}>
<div className={classNames}>
<div
className="data-table__tooltip-truncated-text"
data-tip
@@ -57,6 +57,7 @@ const TooltipTruncatedTextCell = ({
data-tip-disable={isDefaultValue || tooltipDisabled}
>
<span
ref={ref}
className={`data-table__tooltip-truncated-text--cell ${
isDefaultValue ? "text-muted" : ""
} ${tooltipDisabled ? "" : "truncated"}`}
@@ -16,6 +16,7 @@
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
}
}
@@ -1,4 +1,11 @@
/** Modify with extreme caution as this CSS:
- determines whether a tooltip is being rendered via useRef
- is implemented in widely used checkbox labels
- is highly sensitive */
.tooltip-truncated-text {
max-width: 101%; // Required for implementation in checkbox labels
.tooltip-truncated {
max-width: 100%;
}
@@ -8,6 +15,7 @@
max-width: 99%;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
}
.inner-text {