Skip to content

Commit 50b6506

Browse files
committed
List view filtering is now case insensitive.
1 parent c076f22 commit 50b6506

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

js/jquery.mobile.listview.filter.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@ $( ":mobile-listview" ).live( "listviewcreate", function() {
88
return;
99
}
1010

11-
var wrapper = $( "<form>", { 'class': "ui-listview-filter ui-bar-c"} ),
11+
var wrapper = $( "<form>", { "class": "ui-listview-filter ui-bar-c" } ),
1212

13-
search = $( "<input>", { placeholder: "Filter results...", "data-type": "search" })
14-
.bind('keyup change', function() {
15-
var val = this.value;
13+
search = $( "<input>", {
14+
placeholder: "Filter results...",
15+
"data-type": "search"
16+
})
17+
.bind( "keyup change", function() {
18+
var val = this.value.toLowerCase();;
1619
list.children().show();
1720
if ( val ) {
1821
list.children().filter(function() {
19-
return $( this ).text().indexOf( val ) === -1;
22+
return $( this ).text().toLowerCase().indexOf( val ) === -1;
2023
}).hide();
2124
}
2225
})
2326
.appendTo( wrapper )
2427
.customTextInput();
25-
2628

2729
wrapper.insertBefore( list );
2830
});

0 commit comments

Comments
 (0)