On Firefox 39 OS X (not tested on earlier versions of FF) the placeholder text is initially rendered too small and clips trailing characters. This only happens on FF, Chrome and Safari work as expected.
After selecting the control and deselecting, the placeholder expands and is no longer clipped.


My experience is the opposite, I see the problem in Chrome, not in Firefox. Perhaps it depends on the chosen theme (Bootstrap 3 in my case) or the used font.
As a ( bad) workaround, we add spaces at the end of the placeholder.
I think the main issue is in the computation of the width of the text, done in the measureString function. Perhaps some CSS properties are missing (I wonder already at the missing fontStyle, although that's not the issue here).
@PhiLhoSoft I'm using the Bootstrap 3 theme as a base as well so we have cross over there. Nice thought on the workaround, I'll go with that until there's a fix. cheers!
This bug is reproducible on IE 11 also. This fixed it for me:
.selectize-input > input[placeholder] {
width: 100% !important;
}
In the measureString function I changed the width value from 'auto' to '100%' and that worked.
+1
ditto happening in ie11.
@addzies Adding 100% solves the problem only if your selectize is well placed in proper columns (bootstrap grid etc.). With 100% width when the <test> is added to the <body> may result into the full viewport width.
The problems seems to be +4 in the call after
measureString(val) + 4
4 pixels are not nearly enough after the initial space that browsers add to the placeholders in the input.
Looks like we'd need something more reliable for autogrow than "oh, let's add N pixels here"
Was running into this issue and it was related to the styles on the input inside selectize:
.selectize-input {
input[type="text"] {
padding: 0 20px 0 0;
}
}
The above resulted in clipping 20px.
The padding isn't needed and when it's added on render throws off the width of the input depending on your box model.
Same issue but resolved it by setting the box-sizing instead of border-box i've put it on initial and now its showing it proper while using padding.
This fixed it for me:
.selectize-input {
input[placeholder] {
box-sizing: initial;
}
}
Because the width calculator is not keeping track of already existing paddings and/or detecting the border-sizing settings. If I would set the width to width: 100% !important it would give me not the effect of an labeled input field.
Some problem here. MacOS + Google Chrome 55.0.2883. Using Bootstrap 3 and these styles for placeholders in inputs:
::-moz-placeholder {
color: #aaa;
opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
font-family: 'WorkSans Light', sans-serif;
text-align: center;
text-transform: uppercase;
}
:-ms-input-placeholder {
color: #aaa;
font-family: 'WorkSans Light', sans-serif;
text-align: center;
text-transform: uppercase;
}
::-webkit-input-placeholder {
color: #aaa;
font-family: 'WorkSans Light', sans-serif;
text-align: center;
text-transform: uppercase;
}
.selectize-input:not(.has-items) input {
text-align: center;
width: 100% !important;
}


Thank you @kniziol! I used your solution but changed the placeholder colors to #b1b7ba, which seems to be the correct color to match the selectize placeholder in BS3.
width: auto !important; or width: 100% !important; might fix it, but it will break other cases.
This is bug while calculating input width within selectize library (https://github.com/selectize/selectize.js/blob/master/src/selectize.js#L151) and needs to have better calculation.
Hello,
Do check the blog post for supported CSS properties on placeholders.
https://blog.ajcw.com/2011/02/styling-the-html5-placeholder/
I my case, I use Turbolinks, which replaces body tag content on every request, removing the span used to calculate text input width. So I had to "reset" selectize on every page load using the following code:
(window as any).Selectize.$testInput = undefined;
to make it add the span again.
Most helpful comment
This bug is reproducible on IE 11 also. This fixed it for me: