harvesthq / chosen

Deprecated - Chosen is a library for making long, unwieldy select boxes more friendly.

Home Page:http://harvesthq.github.io/chosen/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not support empty options

marcomarsala opened this issue · comments

Steps to reproduce

Tell us how to reproduce this issue.

Insert an empty option like this:
<option value=" "></option>
or like this:
<option value=" "> </option>
in a select

Demo: https://jsfiddle.net/d7crx2f5/

Expected behavior

The empty option should be displayed like all other options.

Actual behavior

The empty option is not displayed.

Environment

  • Chosen Version: 1.8.7

  • jQuery or Prototype Version: jQuery 3.2.1

  • Browser and Version: Chrome 86

  • OS and Version: Windows 7

Additional information

If you write the empty option as <option value=" ">&nbsp;</option> it works.

You can do it very easily - change order your options: empty option must first on list
Demo:
https://jsfiddle.net/yhrmxgso/2/