Open PhilippeOberti opened 1 year ago
The main issue here is that we limit the hight of the legend action to 18px
and the EuiButtonIcon
height is controlled by the size
prop.
It seems that there are a couple of ways to get around this issue:
First approach consists of applying some styles to the EuiButtonIcon
, like
const Button = (
<EuiToolTip content="Test">
<EuiButtonIcon
aria-label="Test"
iconType="boxesHorizontal"
iconSize="s"
size="xs"
onClick={() => setPopoverOpen(!popoverOpen)}
// Add this style here 👇
style={{ height: "100%" }}
/>
</EuiToolTip>
);
Another approach is to not use the EuiButtonIcon
at all. This would avoid EUI highjacking the chart styles, and follow what's already done in the getLegendAction used in the story.
Describe the issue The icon shown when using the legendAction prop can be sometimes misaligned. Using for example eui components (like EuiToolTip, EuiButtonIcon...) breaks a bit the UI:
To Reproduce See demo here which is based off of the 11_legend_actions.story and modify the
getLegendAction
method (found here). TheSettings.legendAction
prop expectsComponentType<LegendActionProps>
which can be implemented with theEuiPopover
. TheEuiPopover
expects abutton
prop to trigger the popover. The storybook example uses an htmlbutton
tag like below...However, when you instead use an
EuiToolTip
withEuiButtonIcon
as thebutton
, this causes the shift in the action alignment.This would result in something like this...
Expected behaviour Using EUI components shouldn't break the way the icons are displayed.