-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Enhancement - Added "create_on_enter" and "create_on_blur" plugins #1138
Conversation
Changes Unknown when pulling 7fd389a on JHereu:master into * on selectize:master*. |
Full gist can be found here: |
Hello jhereu, I was searching for this functionality too to my select when I found your code, thanks! |
Hey @seltix5, glad you found it useful. The I understand it can be useful for other people, so I will remove the if clause and commit it again. Unfortunately, this PR seems to have fallen into oblivion, though. |
I hope the PR gets approved because when I first present this solution the first common mistake was to leave the selectize without confirming to add the new option, losing all the written text. |
Removed If clauses checking if this.mode='multi' in create_on_enter and create_on_blur plugins
Changed author email of create_on_enter and create_on_blur
If clauses already removed in PR. |
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
Added two very simple plugins I needed at some point for multi selectizes to create an option with the text that was already typed without losing it. So, with those two plugins you can:
create_on_enter
: Create option typing and pressingenter
instead oftab
or thedelimiter
character.create_on_blur
: Create option typing and clicking outside (blurring) the box without losing the input.$element.selectize({ plugins: ['create_on_enter', 'create_on_blur'], maxItems: 2 });