Skip to content

Commit

Permalink
Allow AsyncTypeahead to work properly with multi-select version (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgio committed Mar 2, 2017
1 parent c286094 commit 9c65f66
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/containers/asyncContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ const asyncContainer = Typeahead => {
},

_handleSearch(initialQuery) {
const {caseSensitive, minLength, onSearch, useCache} = this.props;
const {
caseSensitive,
minLength,
multiple,
onSearch,
useCache,
} = this.props;

let query = initialQuery.trim();
if (!caseSensitive) {
Expand All @@ -157,8 +163,9 @@ const asyncContainer = Typeahead => {
return;
}

// Only perform a search on user input, not selection.
if (this.state.hasSelection) {
// In the single-selection case, perform a search only on user input
// not selection.
if (!multiple && this.state.hasSelection) {
return;
}

Expand Down

0 comments on commit 9c65f66

Please sign in to comment.