harvesthq/chosen — Issue #362: allow_single_deselect does not work if first option has text
Author: mikejolley
Created: 2011-11-23 11:13:40+00:00
State: open

In the code you have:

``` this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;```

This means it only works when 'text' is empty - well if you have a first option like this:

```
N/A
```

For example, it won't work. Changing it from 'text' to 'value' solves the issues:

``` this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].value === "" ? this.options.allow_single_deselect : false;```