Skip to content

Commit

Permalink
Renders Selected Item when multiple=false
Browse files Browse the repository at this point in the history
  • Loading branch information
KerenChandran committed Mar 23, 2016
1 parent 7dfa13f commit bef1adf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/autocomplete/Autocomplete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ class Autocomplete extends React.Component {
const query = this.state.query.toLowerCase().trim() || '';
const values = this.values();
for (const [key, value] of this.source()) {
if (!values.has(key) && value.toLowerCase().trim().startsWith(query)) {
if (value.toLowerCase().trim().startsWith(query) &&
(!values.has(key) || !this.props.multiple)) {
suggest.set(key, value);
}
}
Expand Down

0 comments on commit bef1adf

Please sign in to comment.