Skip to content
This repository
Browse code

fix list item pruning while filtering

  • Loading branch information...
commit 98b6ea3fb484ae85e354dc24e205260372c0ac18 1 parent 16bd333
authored December 02, 2011

Showing 1 changed file with 2 additions and 4 deletions. Show diff stats Hide diff stats

  1. 6  js/jquery.mobile.listview.filter.js
6  js/jquery.mobile.listview.filter.js
@@ -37,13 +37,11 @@ $( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function(
37 37
 				lastval = $this.jqmData( "lastval" ) + "",
38 38
 				childItems = false,
39 39
 				itemtext = "",
40  
-				item, change;
  40
+				item;
41 41
 
42 42
 			// Change val as lastval for next execution
43 43
 			$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 ) {
47 45
 
48 46
 				// Removed chars or pasted something totally different, check all items
49 47
 				listItems = list.children();

0 notes on commit 98b6ea3

Please sign in to comment.
Something went wrong with that request. Please try again.