I am using jQuery TokenInput from http://loopj.com/jquery-tokeninput/.
I have a senior that user can add only one token so I use tokenLimit: 1
, But when user select the token the another li is added automatically and the element width is increase and design wise it not look proper.
So I use callback function OnAdd
and removing last li so it looks proper now.
But when user removes the selected token then the TokenInput box disappears - I guess because there is no li now. I tried to append li and input text but the functionality is not working.
Can anyone tell me how to correctly reset the TokenInput?
I have read the documentation but found no answer.
I have also tried selector.tokenInput("clear");
that is not working