Skip to content

Commit

Permalink
Add inputRef prop to combobox like other EUI form elements (#1433)
Browse files Browse the repository at this point in the history
* Add inputRef prop to combobox like other EUI form elements

* update changelog
  • Loading branch information
Bargs authored Jan 15, 2019
1 parent 5f20258 commit 5cf5473
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Added `inputRef` prop to `EuiComboBox` ([#1433](https://github.com/elastic/eui/pull/1433))
- Added custom date string formatting for series charts crosshair overlay ([#1429](https://github.com/elastic/eui/pull/1429))

## [`6.3.1`](https://github.com/elastic/eui/tree/v6.3.1)
Expand Down
4 changes: 4 additions & 0 deletions src/components/combo_box/combo_box.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class EuiComboBox extends Component {
isClearable: PropTypes.bool,
fullWidth: PropTypes.bool,
compressed: PropTypes.bool,
inputRef: PropTypes.func,
}

static defaultProps = {
Expand Down Expand Up @@ -448,6 +449,9 @@ export class EuiComboBox extends Component {

searchInputRef = node => {
this.searchInput = node;
if (this.props.inputRef) {
this.props.inputRef(node);
}
};

optionsListRef = node => {
Expand Down
1 change: 1 addition & 0 deletions src/components/combo_box/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ declare module '@elastic/eui' {
rowHeight?: number,
isClearable?: boolean,
fullWidth?: boolean,
inputRef?: (element: HTMLInputElement) => void;
}
export const EuiComboBox: SFC<EuiComboBoxProps>;
}

0 comments on commit 5cf5473

Please sign in to comment.