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

Add inputRef prop to combobox like other EUI form elements #1433

Merged
merged 3 commits into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 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>;
}