Skip to content

Commit 32aa612

Browse files
fix(charts): keep LegendToggle unwrapped to preserve absolute positioning
1 parent a435c6d commit 32aa612

1 file changed

Lines changed: 16 additions & 23 deletions

File tree

src/platform/plugins/shared/charts/public/static/components/legend_toggle.tsx

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import React, { memo, useMemo } from 'react';
1111
import { i18n } from '@kbn/i18n';
12-
import { EuiButtonIcon, EuiToolTip, useEuiTheme } from '@elastic/eui';
12+
import { EuiButtonIcon, useEuiTheme } from '@elastic/eui';
1313
import type { Position } from '@elastic/charts';
1414
import { css } from '@emotion/react';
1515

@@ -51,30 +51,23 @@ const LegendToggleComponent = ({ onClick, showLegend, legendPosition }: LegendTo
5151
);
5252

5353
return (
54-
<EuiToolTip
55-
content={i18n.translate('charts.legend.toggleLegendButtonTitle', {
54+
<EuiButtonIcon
55+
type="button"
56+
iconType="listBullet"
57+
color="text"
58+
onClick={onClick}
59+
css={[
60+
baseStyles,
61+
showLegend ? isOpenStyle : null,
62+
['left', 'bottom'].includes(legendPosition) ? positionStyle : null,
63+
]}
64+
aria-label={i18n.translate('charts.legend.toggleLegendButtonAriaLabel', {
5665
defaultMessage: 'Toggle legend',
5766
})}
58-
disableScreenReaderOutput
59-
>
60-
<EuiButtonIcon
61-
type="button"
62-
iconType="listBullet"
63-
color="text"
64-
onClick={onClick}
65-
css={[
66-
baseStyles,
67-
showLegend ? isOpenStyle : null,
68-
['left', 'bottom'].includes(legendPosition) ? positionStyle : null,
69-
]}
70-
aria-label={i18n.translate('charts.legend.toggleLegendButtonAriaLabel', {
71-
defaultMessage: 'Toggle legend',
72-
})}
73-
aria-expanded={showLegend}
74-
isSelected={showLegend}
75-
data-test-subj="vislibToggleLegend"
76-
/>
77-
</EuiToolTip>
67+
aria-expanded={showLegend}
68+
isSelected={showLegend}
69+
data-test-subj="vislibToggleLegend"
70+
/>
7871
);
7972
};
8073

0 commit comments

Comments
 (0)