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

Commit

Permalink
Custom select: Work with filterable. Fixes #6326.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Aug 12, 2013
1 parent 44bb454 commit 4405004
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions js/widgets/forms/select.custom.js
Expand Up @@ -267,7 +267,7 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {

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

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

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

for ( i = 0; i < numOptions;i++, isPlaceholderItem = false) {
option = $options[i];
$option = $( option );

// Do not create options based on ui-screen-hidden select options
if ( $option.hasClass( "ui-screen-hidden" ) ) {
continue;
}

parent = option.parentNode;
text = $option.text();
anchor = document.createElement( "a" );
Expand Down

0 comments on commit 4405004

Please sign in to comment.