-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Allow users to add their own options #326
Conversation
… (that aren't already in the select).
|
||
Chosen is a library for making long, unwieldy select boxes more user friendly. | ||
Chosen is a great library for turning vanilla 'select' tags into autocompleter-like boxes that are searchable and browsable. This fork adds a new twist by allowing these UI elements to accept new values from the user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the readme should not be changed in the pull request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Done.
And you should modify the sprite to add the new images in it instead of adding separate images |
This reverts commit 91f2e02.
… into the sprite PNG.
Hey Guys, can we get this in the master branch. I want this feature! |
Is there a way to bind this very useful functionality to another key (like ctrl-enter) in some case it can give a litle more control, do you have some thoughts about this? or something like force the user to use the add button and block the enter key, just as an option ofcourse :)? |
If more folks want that, that sounds easy enough to do. Adding code does have a cost in added complexity and risk of bugs, though, so I'm hesitant to add that feature unless sufficiently many people (whatever that means) would find it useful. Personally, I feel like for most applications of this that I can think of ("preferred language", "country of residence", etc), I'd want (as a user) for adding new fields to be as frictionless as possible. What applications are you thinking of? |
I'm not sure, right now I'm using it in a little project for a girlfriend where she have to store books, the related models (to the book) are editorial, authors, genre and donner, it's a very simple application and all this related data is been added trough the plug-in, but some times she is adding some data thinking that when pressing enter is choosing data, am Ï clear? |
Hi jimlindstrom See my comment on #316. I think the UI approach taken in that branch is cleaner.
I haven't reviewed the code for either implementation in detail. If you agree with my UI assessment, and think your implementation has better code, maybe you'd want to update this branch to match the UI in #316. See my comment for two suggested improvements to the UI. |
Will this, #316, or any other approach to add a new value be included soon? |
+1 (for letting users add new tags) |
Thanks @jimlindstrom I'm sorry it took so long to review this. There are several other pull requests that address adding new options and I wanted to give them all a fair shake. To my eyes, it looks as though #166 and #320 are more complete options so I'm going to focus on those. Feel free to weigh in on those threads. |
This adds a 'data-allows-new-values' tag. When present, that tag causes the widget to change how it deals with the "no results" condition. It adds an "add" button and responds to the button or [enter] adding the term you searched for.
Demo: http://jimlindstrom.com/extendable_select/example.html