diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a97b3c67ad..ab912c6afef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/components/combo_box/combo_box.js b/src/components/combo_box/combo_box.js index 732dbb648f3..3959a8d8e86 100644 --- a/src/components/combo_box/combo_box.js +++ b/src/components/combo_box/combo_box.js @@ -49,6 +49,7 @@ export class EuiComboBox extends Component { isClearable: PropTypes.bool, fullWidth: PropTypes.bool, compressed: PropTypes.bool, + inputRef: PropTypes.func, } static defaultProps = { @@ -448,6 +449,9 @@ export class EuiComboBox extends Component { searchInputRef = node => { this.searchInput = node; + if (this.props.inputRef) { + this.props.inputRef(node); + } }; optionsListRef = node => { diff --git a/src/components/combo_box/index.d.ts b/src/components/combo_box/index.d.ts index 41118f3b3dd..7da37f331f4 100644 --- a/src/components/combo_box/index.d.ts +++ b/src/components/combo_box/index.d.ts @@ -73,6 +73,7 @@ declare module '@elastic/eui' { rowHeight?: number, isClearable?: boolean, fullWidth?: boolean, + inputRef?: (element: HTMLInputElement) => void; } export const EuiComboBox: SFC; }