Skip to content

Commit

Permalink
Add event to autocomplete onBlur
Browse files Browse the repository at this point in the history
  • Loading branch information
onchainguy-btc committed Oct 22, 2016
1 parent eefa426 commit b2ad418
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ const factory = (Chip, Input) => {
);
};

handleQueryBlur = () => {
handleQueryBlur = (event) => {
if (this.state.focus) this.setState({focus: false});
if (this.props.onBlur) this.props.onBlur();
if (this.props.onBlur) this.props.onBlur(event);
};

handleQueryChange = (value) => {
Expand Down
4 changes: 2 additions & 2 deletions lib/autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ var factory = function factory(Chip, Input) {
_this.setState({ focus: false, query: query, showAllSuggestions: _this.props.showSuggestionsWhenValueIsSet }, function () {
_reactDom2.default.findDOMNode(_this).querySelector('input').blur();
});
}, _this.handleQueryBlur = function () {
}, _this.handleQueryBlur = function (event) {
if (_this.state.focus) _this.setState({ focus: false });
if (_this.props.onBlur) _this.props.onBlur();
if (_this.props.onBlur) _this.props.onBlur(event);
}, _this.handleQueryChange = function (value) {
_this.setState({ query: value, showAllSuggestions: false });
}, _this.handleQueryFocus = function () {
Expand Down
2 changes: 1 addition & 1 deletion lib/autocomplete/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ interface AutocompleteProps extends ReactToolbox.Props {
* If true, the list of suggestions will not be filtered when a value is selected.
* @default false
*/
showSuggestionsWHenValueIsSet?: boolean;
showSuggestionsWhenValueIsSet?: boolean;
/**
* Object of key/values or array representing all items suggested.
*/
Expand Down

0 comments on commit b2ad418

Please sign in to comment.