Skip to content

Commit 1e88b3b

Browse files
Listview filter: Check if var listview is defined. Fixes jquery-archive#5696 and jquery-archive#5643
The listviewcreate event bubbles up which causes an error if a listview is nested in an UL or OL without data-role="listview".
1 parent fe754c9 commit 1e88b3b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

js/widgets/listview.filter.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ var defaultFilterCallback = function( text, searchValue, item ) {
2020
$.mobile.listview.prototype.options.filterCallback = defaultFilterCallback;
2121

2222
$.mobile.document.delegate( "ul, ol", "listviewcreate", function() {
23-
2423
var list = $( this ),
2524
listview = list.data( "mobile-listview" );
2625

27-
if ( !listview.options.filter ) {
26+
if ( !listview || !listview.options.filter ) {
2827
return;
2928
}
3029

0 commit comments

Comments
 (0)