Skip to content

Commit 04e7838

Browse files
committed
keep case of search term (but still case-insensitive)
1 parent 714f9a3 commit 04e7838

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"react-search-input.js",
55
"react-search-input.css"
66
],
7-
"version": "0.2.2",
7+
"version": "0.2.3",
88
"homepage": "https://github.com/enki-com/react-search-input",
99
"description": "Simple react.js component for a search input, providing a filter function.",
1010
"keywords": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-search-input",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "Simple react.js component for a search input, providing a filter function.",
55
"main": "react-search-input.js",
66
"dependencies": {

react-search-input.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636

3737
updateSearch: function(e) {
38-
var searchTerm = e.target.value.toLowerCase();
38+
var searchTerm = e.target.value;
3939
this.setState({
4040
searchTerm: searchTerm
4141
}, function() {
@@ -60,7 +60,8 @@
6060
return function(item) {
6161
if (term === '') {return true;}
6262
// escape special symbols to ensure `term` is a valid regex
63-
var escapedTerm = term.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
63+
//var escapedTerm = term.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
64+
term = term.toLowerCase();
6465

6566
if (keys) {
6667
if( typeof keys === 'string' ) {

0 commit comments

Comments
 (0)