Skip to content

Commit

Permalink
Merge pull request react-bootstrap#29 from not-raspberry/fix-string-i…
Browse files Browse the repository at this point in the history
…nterpreted-as-a-re

bugfix: user input was interpreted as a regular expression
  • Loading branch information
prakhar1989 committed Nov 27, 2015
2 parents f6d9573 + c33ab97 commit d124265
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/reactTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var ReactTags = React.createClass({

var query = e.target.value.trim();
var suggestions = this.props.suggestions.filter(function(item) {
return (item.toLowerCase()).search(query.toLowerCase()) === 0;
return item.toLowerCase().startsWith(query.toLowerCase());
});

this.setState({
Expand Down

0 comments on commit d124265

Please sign in to comment.