0

I need to allow space at first position in bootstrap tagsinput. Need Resulted Tag Like this: " Tag" not like "Tag" that.

I have tried Trim (methods: false) and it is working fine for tag's post space but not working for tag's pre space.

Please suggest as soon as possible. Thanks in advance.

4

2 回答 2

2

The leading white space is there, is just not shown by the browser. You can check this with an inspector. Adding the CSS declaration for the class that renders the labels, should solve the problem and show the leading white spaces.

.bootstrap-tagsinput .tag {
    white-space: pre;
}
于 2016-09-14T07:29:50.040 回答
0

Just append a space to the first string in your array

data[0].text = ' ' + data[0].text;

if text is your label field.

于 2016-09-14T07:24:07.153 回答