Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit df68b01

Browse files
committed
second attempt to fix #2416
1 parent afe6630 commit df68b01

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

js/jquery.mobile.listview.filter.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,11 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
4040
lastval = $this.jqmData( "lastval" ) + "",
4141
childItems = false,
4242
itemtext = "",
43-
item, change,
44-
regex = "";
45-
46-
try {
47-
regex = new RegExp( "^" + lastval );
48-
} catch (e) {}
43+
item, change;
4944

5045
// Change val as lastval for next execution
5146
$this.jqmData( "lastval" , val );
52-
change = val.replace( regex , "" );
47+
change = val.substr( 0 , lastval.length + 1 ).replace( lastval , "" );
5348

5449
if ( val.length < lastval.length || change.length != ( val.length - lastval.length ) ) {
5550

0 commit comments

Comments
 (0)