tom-select icon indicating copy to clipboard operation
tom-select copied to clipboard

[Bug]: controlInput: null + change_listener plugin causes empty label to blank

Open jasonbouffard opened this issue 5 months ago • 1 comments

Bug description

With a fairly straightforward configuration and an empty first <option>, when the user clicks back into the empty option. Tom Select clears the drop-down.

const config = {plugins: ['change_listener'], allowEmptyOption: true, controlInput:null};
const ts = new TomSelect('#test', config);
<select name="test" id="test" data-placeholder="Choose...">
  <option value="">Empty</option>
  <option value="1">One</option>
  <option value="2">Two</option>
</select>

Expected behavior

I would expect the empty <option>'s label to be seen.

Steps to reproduce

https://jsfiddle.net/jpb0104/Lzmvyobj/6/

Select an option other than the empty one. Then click back into the empty one.

Additional context

No additional context needed

jasonbouffard avatar Sep 23 '24 15:09 jasonbouffard