Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not allow spacebar #5

Closed
folkevil opened this issue Apr 9, 2014 · 5 comments
Closed

Not allow spacebar #5

folkevil opened this issue Apr 9, 2014 · 5 comments

Comments

@folkevil
Copy link

folkevil commented Apr 9, 2014

In some cases i want to put space in strings, but when i type space button it create new tag.

@sniperwolf
Copy link
Owner

Hi @folkevil,

This happens because, in default options, spacebar is a key that add a new tag. If you want to avoid it, you can use one of the three way to customize the behavior. The option is "no-spacebar" You can find here all info.

Let me know If you solve it ;)

@sniperwolf
Copy link
Owner

Some sample code:

First way

In your main JS file, type:

var my_custom_options = { "no-spacebar": true };

And then:

$("#tagBox").tagging(my_custom_options);

Second way

Add a data attribuite to your tagBox:

<div data-no-spacebar="true" id="tagBox">preexisting-tag</div>

And then in your main JS file, type:

$("#tagBox").tagging();

@sniperwolf sniperwolf reopened this Apr 10, 2014
@sniperwolf
Copy link
Owner

Please, update your taggingJS version to v1.2.5.

@josephdpurcell
Copy link

Just wanted to note that I'm really glad no-spacebar is an option. We are looking at porting over from Selectize (http://brianreavis.github.io/selectize.js/) and need to have legacy support for spaces. Very nice library, thanks for your hard work!

@folkevil
Copy link
Author

thanks for your hard work @sniperwolf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants