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>
pull/107149/head
Jesse David Peterson 3 days ago committed by GitHub
parent c80fe53620
commit cff743fcd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      packages/grafana-ui/src/components/VizTooltip/VizTooltipColorIndicator.tsx
  2. 9
      packages/grafana-ui/src/components/VizTooltip/VizTooltipRow.tsx

@ -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',

@ -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,

Loading…
Cancel
Save