Closed o0x2a closed 10 years ago
:+1: Fix works for me!
:+1:
This good be an idea to implement placeholder support for
select
elements as it is conformed with w3c.
<select placeholder>
is non-standard and is not implemented anywhere either. The spec you linked to doesn’t mention it — it uses the word placeholder
in a different context.
When using selectize alongside jquery.placeholder, it adds the string 'undefined' when clicking on a selected value to change it. This is caused because the placeholder is set with an empty option inside select, then selectize turn this to an
input
element and set the properplaceholder
attribute. It means an unnecessary placeholder event has been fired on an element which expected to have placeholder. This change fix this issue by checking if the value ofplaceholder
attribute is valid before adding it to theinput
element. This good be an idea to implement placeholder support forselect
elements as it is conformed with w3c.