Skip to content

Commit fbeff4a

Browse files
authored
[EuiSelectable][EuiComboBox] Fix group label append not being clickable (#9678)
1 parent 3886a10 commit fbeff4a

6 files changed

Lines changed: 25 additions & 10 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**Bug fixes**
2+
3+
- Fixed an issue in `EuiSelectable` and `EuiComboBox` where interactive content in group labels wasn't clickable due to overlapping content.

packages/eui/src/components/combo_box/combo_box.stories.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
import { LOKI_SELECTORS, lokiPlayDecorator } from '../../../.storybook/loki';
1818
import { EuiCode } from '../code';
1919
import { EuiFlexItem } from '../flex';
20+
import { EuiLink } from '../link';
2021

2122
import { EuiComboBoxOptionMatcher } from './types';
2223
import { EuiComboBox, EuiComboBoxProps } from './combo_box';
@@ -244,7 +245,9 @@ export const Groups: Story = {
244245
isGroupLabelOption: true,
245246
prepend: '#prepend ',
246247
append: (
247-
<EuiFlexItem css={{ alignItems: 'flex-end' }}>(append)</EuiFlexItem>
248+
<EuiFlexItem css={{ alignItems: 'flex-end' }}>
249+
<EuiLink>(append)</EuiLink>
250+
</EuiFlexItem>
248251
),
249252
},
250253
...[...options].splice(3, options.length),
@@ -275,7 +278,9 @@ export const NestedOptionsGroups: Story = {
275278
isGroupLabelOption: true,
276279
prepend: '#prepend ',
277280
append: (
278-
<EuiFlexItem css={{ alignItems: 'flex-end' }}>(append)</EuiFlexItem>
281+
<EuiFlexItem css={{ alignItems: 'flex-end' }}>
282+
<EuiLink>(append)</EuiLink>
283+
</EuiFlexItem>
279284
),
280285
options: [...options].splice(3, options.length),
281286
},

packages/eui/src/components/selectable/selectable.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
EuiSelectableOnChangeEvent,
2323
EuiSelectableProps,
2424
} from './selectable';
25+
import { EuiLink } from '../link';
2526

2627
const toolTipProps = {
2728
toolTipContent: 'This is a tooltip!',
@@ -157,7 +158,9 @@ export const WithSearchAndGroups: Story = {
157158
isGroupLabel: true,
158159
prepend: <EuiIcon type="warning" />,
159160
append: (
160-
<EuiFlexItem css={{ alignItems: 'flex-end' }}>(append)</EuiFlexItem>
161+
<EuiFlexItem css={{ alignItems: 'flex-end' }}>
162+
<EuiLink>append</EuiLink>
163+
</EuiFlexItem>
161164
),
162165
},
163166
...[...options].splice(4, options.length),

packages/eui/src/components/selectable/selectable_list/__snapshots__/selectable_list.test.tsx.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports[`EuiSelectableListItem group labels handles updating aria attrs correctl
1717
tabindex="0"
1818
>
1919
<li
20-
class="euiSelectableList__groupLabel css-1ku7zw3-groupLabel-EuiSelectableList"
20+
class="euiSelectableList__groupLabel css-rtav68-groupLabel-EuiSelectableList"
2121
role="presentation"
2222
>
2323
Moons
@@ -73,7 +73,7 @@ exports[`EuiSelectableListItem group labels handles updating aria attrs correctl
7373
</span>
7474
</li>
7575
<li
76-
class="euiSelectableList__groupLabel css-1ku7zw3-groupLabel-EuiSelectableList"
76+
class="euiSelectableList__groupLabel css-rtav68-groupLabel-EuiSelectableList"
7777
role="presentation"
7878
>
7979
Planets
@@ -129,7 +129,7 @@ exports[`EuiSelectableListItem group labels handles updating aria attrs correctl
129129
</span>
130130
</li>
131131
<li
132-
class="euiSelectableList__groupLabel css-1ku7zw3-groupLabel-EuiSelectableList"
132+
class="euiSelectableList__groupLabel css-rtav68-groupLabel-EuiSelectableList"
133133
role="presentation"
134134
>
135135
Suns
@@ -212,7 +212,7 @@ exports[`EuiSelectableListItem group labels renders with correct aria-setsize an
212212
</span>
213213
</li>
214214
<li
215-
class="euiSelectableList__groupLabel css-1ku7zw3-groupLabel-EuiSelectableList"
215+
class="euiSelectableList__groupLabel css-rtav68-groupLabel-EuiSelectableList"
216216
role="presentation"
217217
style="position: absolute; left: 0px; top: 32px; height: 48px; width: 100%;"
218218
>
@@ -271,7 +271,7 @@ exports[`EuiSelectableListItem group labels renders with correct aria-setsize an
271271
</span>
272272
</li>
273273
<li
274-
class="euiSelectableList__groupLabel css-1ku7zw3-groupLabel-EuiSelectableList"
274+
class="euiSelectableList__groupLabel css-rtav68-groupLabel-EuiSelectableList"
275275
role="presentation"
276276
style="position: absolute; left: 0px; top: 144px; height: 48px; width: 100%;"
277277
>
@@ -330,7 +330,7 @@ exports[`EuiSelectableListItem group labels renders with correct aria-setsize an
330330
</span>
331331
</li>
332332
<li
333-
class="euiSelectableList__groupLabel css-1ku7zw3-groupLabel-EuiSelectableList"
333+
class="euiSelectableList__groupLabel css-rtav68-groupLabel-EuiSelectableList"
334334
role="presentation"
335335
style="position: absolute; left: 0px; top: 256px; height: 48px; width: 100%;"
336336
>

packages/eui/src/components/selectable/selectable_list/selectable_list.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { EuiIcon } from '../../icon';
2121
import { EuiText } from '../../text';
2222
import { EuiBadge } from '../../badge';
2323
import { EuiSelectableOption } from '../selectable_option';
24+
import { EuiLink } from '../../link';
2425

2526
import { EuiSelectableList, EuiSelectableListProps } from './selectable_list';
2627

@@ -168,7 +169,9 @@ export const Groups: Story = {
168169
isGroupLabel: true,
169170
prepend: <EuiIcon type="warning" />,
170171
append: (
171-
<EuiFlexItem css={{ alignItems: 'flex-end' }}>(append)</EuiFlexItem>
172+
<EuiFlexItem css={{ alignItems: 'flex-end' }}>
173+
<EuiLink>(append)</EuiLink>
174+
</EuiFlexItem>
172175
),
173176
},
174177
...[...options].splice(4, options.length),

packages/eui/src/components/selectable/selectable_list/selectable_list.styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export const euiSelectableListGroupLabelStyles = (
8686
&::before {
8787
content: '';
8888
position: absolute;
89+
z-index: -1;
8990
inset: 0;
9091
inset-block-start: ${spacingVertical};
9192
${logicalCSS(

0 commit comments

Comments
 (0)