Skip to content
Advertisement

selectize.js placeholder width issue

I am using selectize.js jquery library for autocomplete (autosuggest) functionality.

Everything working good except from placeholder issue.

Below is my code what I have done.

HTML CODE

JavaScript

JAVASCRIPT CODE

JavaScript

This is how it looks like when I load the page.

enter image description here

Its showing full text of placeholder .. but when I am about to type and getting the hint and select anything and when I am clearing all items, its width decreased and showing something like below.

enter image description here

As we can see, placeholder text is cutting.

This is a video link how its behaving at the moment – http://www.screencast.com/t/B1w1TssUAelI

I have tried to put few events which does not work.

Can someone help me how to solve this ?

Advertisement

Answer

OK Guys, Eventually I have solved this and below is the code I put in my javascript file.

JAVASCRIPT CODE

JavaScript

AS you can see in above code, I have added below code into it.

JavaScript

This will set the width to 100% whenever I update my selections even if I delete all my selections, this will work.

Hope this helps.

Advertisement