eui icon indicating copy to clipboard operation
eui copied to clipboard

[EuiFormControlLayoutDelimited] EuiSelect elements lose their dropdown arrow

Open Zacqary opened this issue 3 years ago • 1 comments

When putting an EuiSelect in one of the control slots, the dropdown arrow gets pushed away.

Expected

Screen Shot 2022-07-08 at 1 59 06 PM

Actual

Screen Shot 2022-07-08 at 1 59 23 PM

This is because the layout control overrides styles on .euiFormControlLayoutIcons that EuiSelect relies on to position its dropdown arrow. To work around this, wrap the <EuiFormControlLayoutDelimited> in a styled div with:

& .euiFormControlLayout__childrenWrapper {
    &:last-of-type {
      position: relative;
      & .euiFormControlLayoutIcons {
        position: absolute;
        padding: 0;
      }
    }
  }

Zacqary avatar Jul 08 '22 19:07 Zacqary

The delimited form control isn't meant to be used in this manner. It's mean to show a range of multiple values. Instead, you should use the prepend and append mechanisms to add a dropdown for the last option. Screen Shot 2022-07-25 at 16 31 06 PM

<EuiFieldNumber
  prepend="Every"
  append={
    <EuiButtonEmpty
      color="text"
      size="xs"
      iconType="arrowDown"
      iconSide="right"
    >
      days
    </EuiButtonEmpty>
  }
/>

cchaos avatar Jul 25 '22 20:07 cchaos

👋 This issue hasn't seen activity in 3 days, so we're automatically closing this issue as answered. Please leave a comment if that's not the case, or if you have any remaining questions or issues.

github-actions[bot] avatar Dec 16 '22 00:12 github-actions[bot]