Javi Velasco 2017-01-04 15:14:26 +01:00
parent 2a7010b022
commit bf00d92d68
2 changed files with 8 additions and 2 deletions

View File

@ -120,10 +120,10 @@ const factory = (Chip, Input) => {
this.setState({query: value, showAllSuggestions: false, active: null});
};
handleQueryFocus = () => {
handleQueryFocus = (event) => {
this.suggestionsNode.scrollTop = 0;
this.setState({active: '', focus: true});
if (this.props.onFocus) this.props.onFocus();
if (this.props.onFocus) this.props.onFocus(event);
};
handleQueryKeyDown = (event) => {

View File

@ -14,6 +14,11 @@ class AutocompleteTest extends React.Component {
}
};
handleFocus = (event) => {
console.log('This is focused');
console.log(event);
};
handleMultipleArrayChange = (value) => {
this.setState({
multipleArray: value,
@ -48,6 +53,7 @@ class AutocompleteTest extends React.Component {
allowCreate
keepFocusOnChange
label="Pick multiple elements..."
onFocus={this.handleFocus}
onChange={this.handleMultipleArrayChange}
source={this.state.countriesObject}
suggestionMatch="anywhere"