简体   繁体   中英

selectize js search not working

Search option is not working with single select although It is working with multi select.

Below is the code:

html:

<select id="select-name" placeholder="Select a person..." >  
    <option value="4">Thomas Edison</option>    
    <option value="5">Arnold Schwarzenegger</option>
</select>

js:

$(function() {
   $('#select-name').selectize();
});

This is not documented, I believe, and I find it the hard way by comparing the provided samples. You have to add an option with the value of "" to get that result.

<select id="select-name" placeholder="Select a person..." >  
    <option value="">Select a Person</option>  
    <option value="1">Person 1</option>    
    <option value="2">Person 2</option>
</select>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM