ToolTip: Fix flexbox bug with tooltip when maxWidth is set manually (#107145)

Fix flexbox bug with tooltip when maxWidth is set manually.

fix for #105517

Co-authored-by: Jason <jdmarshall@users.noreply.github.com>
This commit is contained in:
Jesse David Peterson
2025-06-24 14:08:27 -04:00
committed by GitHub
parent c80fe53620
commit cff743fcd5
2 changed files with 10 additions and 1 deletions

View File

@ -56,9 +56,11 @@ export const VizTooltipColorIndicator = ({
const getStyles = (theme: GrafanaTheme2) => ({
leading: css({
marginRight: theme.spacing(0.5),
flex: 'none',
}),
trailing: css({
marginLeft: theme.spacing(0.5),
flex: 'none',
}),
value: css({
width: '12px',

View File

@ -129,7 +129,7 @@ export const VizTooltipRow = ({
return (
<div className={styles.contentWrapper}>
{(color || label) && (
<div className={styles.valueWrapper}>
<div className={styles.labelWrapper}>
{color && colorPlacement === ColorPlacement.first && (
<VizTooltipColorIndicator color={color} colorIndicator={colorIndicator} lineStyle={lineStyle} />
)}
@ -221,6 +221,12 @@ const getStyles = (theme: GrafanaTheme2, justify: string, marginRight: string) =
overflow: 'hidden',
marginRight: theme.spacing(2),
}),
labelWrapper: css({
display: 'flex',
alignItems: 'center',
flex: '2',
minWidth: 0,
}),
value: css({
fontWeight: 500,
textOverflow: 'ellipsis',
@ -229,6 +235,7 @@ const getStyles = (theme: GrafanaTheme2, justify: string, marginRight: string) =
valueWrapper: css({
display: 'flex',
alignItems: 'center',
flex: '1',
}),
activeSeries: css({
fontWeight: theme.typography.fontWeightBold,