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

Commit 4405004

Browse files
author
Gabriel Schulhof
committed
Custom select: Work with filterable. Fixes #6326.
1 parent 44bb454 commit 4405004

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

js/widgets/forms/select.custom.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
267267

268268
_isRebuildRequired: function() {
269269
var list = this.list.find( "li" ),
270-
options = this._selectOptions();
270+
options = this._selectOptions().not( ".ui-screen-hidden" );
271271

272272
// TODO exceedingly naive method to determine difference
273273
// ignores value changes etc in favor of a forcedRebuild
@@ -414,13 +414,19 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
414414
optLabel, divider, item;
415415

416416
self.list.empty().filter( ".ui-listview" ).listview( "destroy" );
417-
$options = this.select.find( "option" );
417+
$options = this._selectOptions();
418418
numOptions = $options.length;
419419
select = this.select[ 0 ];
420420

421421
for ( i = 0; i < numOptions;i++, isPlaceholderItem = false) {
422422
option = $options[i];
423423
$option = $( option );
424+
425+
// Do not create options based on ui-screen-hidden select options
426+
if ( $option.hasClass( "ui-screen-hidden" ) ) {
427+
continue;
428+
}
429+
424430
parent = option.parentNode;
425431
text = $option.text();
426432
anchor = document.createElement( "a" );

0 commit comments

Comments
 (0)