Merge pull request #1689 from velveret/autocomplete-autofocus

Allow autoFocus on Autocomplete component
old
Rubén Moya 2018-01-23 18:19:35 +01:00 committed by GitHub
commit f75fd26207
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -134,7 +134,7 @@ const factory = (Chip, Input) => {
};
handleQueryFocus = (event) => {
this.suggestionsNode.scrollTop = 0;
event.target.scrollTop = 0;
this.setState({ active: '', focus: true });
if (this.props.onFocus) this.props.onFocus(event);
};
@ -381,7 +381,6 @@ const factory = (Chip, Input) => {
return (
<ul
className={classnames(theme.suggestions, { [theme.up]: this.state.direction === 'up' })}
ref={(node) => { this.suggestionsNode = node; }}
>
{suggestions}
</ul>