Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combobox fixes #1183

Merged
merged 2 commits into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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