Skip to content

Commit

Permalink
Combobox fixes (#1183)
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos authored Sep 11, 2018
1 parent 6c02111 commit 1ae816b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
- Added `euiFacetButton` and `euiFacetGroup` ([#1167](https://github.com/elastic/eui/pull/1167))
- Added `width` prop to `EuiContextMenu` panels ([#1173](https://github.com/elastic/eui/pull/1173))

**Bug fixes**

- Fixed `onClickAriaLabel` console error stemming from `EuiComboBoxPill` ([#1183](https://github.com/elastic/eui/pull/1183))

## [`3.10.0`](https://github.com/elastic/eui/tree/v3.10.0)

- Added `maxWidth` prop to `EuiModal` ([#1165](https://github.com/elastic/eui/pull/1165))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
line-height: $euiSizeL - 2px;

&--plainText {
line-height: $euiSizeL;
font-size: $euiFontSizeS;
font-family: $euiFontFamily;
padding: 0 $euiSizeXS;
Expand Down
21 changes: 19 additions & 2 deletions src/components/combo_box/combo_box_input/combo_box_pill.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export class EuiComboBoxPill extends Component {
color: PropTypes.string,
onClose: PropTypes.func,
asPlainText: PropTypes.bool,
onClick: PropTypes.func,
onClickAriaLabel: PropTypes.string,
};

static defaultProps = {
Expand All @@ -30,6 +32,8 @@ export class EuiComboBoxPill extends Component {
option, // eslint-disable-line no-unused-vars
onClose, // eslint-disable-line no-unused-vars
color,
onClick,
onClickAriaLabel,
asPlainText,
...rest
} = this.props;
Expand All @@ -54,6 +58,8 @@ export class EuiComboBoxPill extends Component {
closeButtonProps={{
tabIndex: '-1',
}}
onClick={onClick}
onClickAriaLabel={onClickAriaLabel}
{...rest}
>
{children}
Expand All @@ -62,11 +68,22 @@ export class EuiComboBoxPill extends Component {
}

if (asPlainText) {
return <span className={classes} {...rest}>{children}</span>;
return (
<span className={classes} {...rest}>
{children}
</span>
);
}

return (
<EuiBadge className={classes} title={children} color={color} {...rest}>
<EuiBadge
className={classes}
title={children}
color={color}
{...rest}
onClick={onClick}
onClickAriaLabel={onClickAriaLabel}
>
{children}
</EuiBadge>
);
Expand Down

0 comments on commit 1ae816b

Please sign in to comment.