Skip to content

Commit 98b6ea3

Browse files
author
Marcus Lunzenauer
committed
fix list item pruning while filtering
1 parent 16bd333 commit 98b6ea3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

js/jquery.mobile.listview.filter.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ $( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function(
3737
lastval = $this.jqmData( "lastval" ) + "",
3838
childItems = false,
3939
itemtext = "",
40-
item, change;
40+
item;
4141

4242
// Change val as lastval for next execution
4343
$this.jqmData( "lastval" , val );
44-
change = val.substr( 0 , lastval.length - 1 ).replace( lastval , "" );
45-
46-
if ( val.length < lastval.length || change.length != ( val.length - lastval.length ) ) {
44+
if ( val.length < lastval.length || val.indexOf(lastval) !== 0 ) {
4745

4846
// Removed chars or pasted something totally different, check all items
4947
listItems = list.children();

0 commit comments

Comments
 (0)