vue2-selectize icon indicating copy to clipboard operation
vue2-selectize copied to clipboard

Use options without value attribute

Open plashenkov opened this issue 7 years ago • 2 comments

Standard selects allow us to use options without specifying value attributes. In that case content inside <option> tag will be used as a value.

If I remember correctly, pure Selectize.js library allows to use options without value attribute.

vue2-selectize in that case causes errors to the console and does not operate correctly.

plashenkov avatar Oct 26 '17 12:10 plashenkov

Is there any particular use-case for this that can't be achieved with the current implementation?

rhyek avatar Oct 27 '17 16:10 rhyek

Sure. Intuitively you try to use this component as a replacement for selects. You use <option> without value, which is totally legal with <select> and then suddenly wonder why and what does not work as expected. I used three selectizes on my page and I had to examine each component to see why something was not working. And I found out that in one component value attributes were not set explicitly.

Well, if you cannot or do not plan to allow the ability to omit value attributes, some remark would be useful in README: you MUST explicitly set value attributes in each option.

plashenkov avatar Oct 27 '17 17:10 plashenkov