-
Notifications
You must be signed in to change notification settings - Fork 328
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 for custom-entered choices to be used in the combo box #20
Conversation
This is because, in this patch, the select is a data source rather than an actual control
All tests pass after this commit
I forgot to mention-- a side effect of this is, the combo box must be initialized before the selected element is set. This is because the default |
This is important because this behavior is expected from a combobox control. |
I understand that a traditional combobox allows free form entry. That isn't something I have any use case for. This was created to be a typeahead keyboard enabled selectbox. I going to close this. If you want to maintain a fork I'll link to it with a little paragraph explaining why there is a difference. |
+1! Hopefully this will come up again in the future for inclusion but for now I can make use of the fork. :) |
So, has anyone forked this project to make it a real combobox since then? I was just looking for a real combobox for bootstrap like many others and found this repo. Unfortunately the project name is totally misleading. It really looks good and it looks like a combobox, but a combobox as defined by all the GUIs in the past decades is a text field that allows for selection of some predefined values as well. This project on the other hand is 'just' a searchable/autocomplete select box like http://ivaynberg.github.io/select2/ |
Simmer down. It's on the roadmap. On Wednesday, June 5, 2013, martenlehmann wrote:
|
Is there any chance this will be implemented as a feature anytime soon? |
While this may not be ideal in all cases, I needed a combo box that allowed for custom text to be input into it.
Original Behavior
Entering custom text into the combo box results in the combo box clearing the new input. This is because the combo box only allows for users to type any of the results already in the original
select
box.New Behavior
Entering custom text into the combo box results in the text staying. In addition, this custom value is submitted in the form.
Method
The name from the original
select
is extracted, and given to the newinput
field in the combo box. Theselect
's name is then removed. This results in the correct value being submitted in the form. The behavior where theinput
is cleared if a pre-defined value is not entered (i.e. "Washington" is entered into your demo) is removed as well, to allow for custom text to be entered.I figure this may be useful for some people, though it may not entirely fit with the goals of this combo box. Alternatively, instead of merging this patch into danielfarrells's combo box, I can maintain a separate repository with these changes for those people that want this functionality.