Selectize.js: Selectize deletes data attributes from select options

Created on 16 Nov 2016  路  18Comments  路  Source: selectize/selectize.js

When selectize is applied to a select, its options' data attributes are removed.

<select id="s">
  <option value="foo" data-bar="baz" selected>Foo</option>
</select>
var $s = $("#s");
alert($s.find("option:selected").data("bar"));
$(s).selectize();
alert($s.find("option:selected").data("bar"));

https://jsfiddle.net/u6qobn24/

All 18 comments

Have fixed this in PR #1206, although I now see this fails a test. Think the test may need rewriting. Maybe someone else can assist.

this is fairly important, any movement on this?

+1 to this. I think all data-attributes on select and options should be preserved.

+1 to this. as well

+1

+1

@joallard @brianreavis please merge

+1

+1

+1

+1

+1

+1

+1

+1

+1

closing stale issues older than one year.
If this issue was closed in error please message the maintainers.
All issues must include a proper title, description, and examples.

Everything you should not do.

closing stale issues older than one year.
If this issue was closed in error please message the maintainers.
All issues must include a proper title, description, and examples.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eliashdezr picture eliashdezr  路  41Comments

notflip picture notflip  路  15Comments

ghost picture ghost  路  60Comments

agborkowski picture agborkowski  路  14Comments

CarlosLlongo picture CarlosLlongo  路  18Comments