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

User add item & multi-select #39

Closed
Tam opened this issue Sep 12, 2016 · 33 comments · May be fixed by #856
Closed

User add item & multi-select #39

Tam opened this issue Sep 12, 2016 · 33 comments · May be fixed by #856

Comments

@Tam
Copy link

Tam commented Sep 12, 2016

Is it possible to mix multi-select with the users ability to add custom items? Or alternatively, give the text field some predefined suggestions in the style of the multi-select?

I've tried setting the choices option when targeting a text field, but it doesn't seem to work.

@jshjohnson jshjohnson added enhancement Pull request that improves existing functionality feature request labels Sep 12, 2016
@jshjohnson
Copy link
Collaborator

The ability to add custom items to a multi-select is a definite possibility - that would be fairly simple to implement. Thanks for the suggestion.

@dgrammatiko
Copy link
Contributor

@jshjohnson if you are about to implement this feature can I also ask to apply this also for single select option tag? It would be great help on something I'm currently working...

@dgrammatiko
Copy link
Contributor

dgrammatiko commented Nov 6, 2016

@jshjohnson I would like to give you some input here, so for the single value:

http://codepen.io/dgt41/pen/xRbpwK/

And for the multiple values:

http://codepen.io/dgt41/pen/RoNxro

And couple remarks here:

  • there should be an option for the value (both for single and multiple)
  • the search should return ONLY exact results not partials as it is ATM

Hope this is somehow helpful

@jshjohnson jshjohnson removed the enhancement Pull request that improves existing functionality label Nov 7, 2016
@dgrammatiko
Copy link
Contributor

@jshjohnson any ETA here?

@jshjohnson
Copy link
Collaborator

@dgt41

I'll be looking at this as soon as I can - very busy this week though. I'm happy to review pull requests.

@jshjohnson
Copy link
Collaborator

Just to give an update, I've begun work on this within a feature branch

@dgrammatiko
Copy link
Contributor

@jshjohnson I did some testing on the feature branch, so for the single the item is added but is not active:
screen shot 2016-11-14 at 22 48 32

For the multiple I do get some strange behaviour, adding a new item will also add another (already existing) item. I hope I can find some time debugging and contributing some code

@StephaneTrebel
Copy link
Contributor

StephaneTrebel commented Nov 18, 2016

FYI, I've a pushed a PR (#79) to help complete this feature.
Feel free to comment !

@jshjohnson
Copy link
Collaborator

jshjohnson commented Nov 18, 2016

Thanks to the PR from @StephaneTrebel, we're close to getting this feature through the door.

Things left to do:

  • Ensure the select box stays focussed after inputting a custom choice
  • Ensure the duplicateItems config option works with select elements (i.e. no inputting a value that already exists)
  • Ensure added values are shown in the dropdown if the dropdown contains groups

@StephaneTrebel
Copy link
Contributor

FYI, I've done some tests and I think that :

  • Ensure the duplicateItems config option works with select elements (i.e. no inputting a value that already exists)

is ok.

I have not tested the groups since I don't use them yet. If I do I'll give a heads up :)

@erikskar
Copy link

Sorry, I do not understand how I do it.
Is it working or not?
Or is it still in development?

@jshjohnson
Copy link
Collaborator

jshjohnson commented Dec 16, 2016

@erikskar This feature is still in development (in the feature/select-add-items branch)

@rstacruz
Copy link
Contributor

Can we help?

@jshjohnson
Copy link
Collaborator

Hi @rstacruz - sure! I think this feature is really close to completion. It just needs some unit tests + some investigation into option groups (i.e what should happen if you have a groups of options and you add a new option).

@dgrammatiko
Copy link
Contributor

@jshjohnson any progress here?
Can you release a beta (that doesn't include the groups part)?

Thanks

@ea2809
Copy link

ea2809 commented Mar 16, 2017

News...

@jshjohnson
Copy link
Collaborator

There is still one issue here if you have a select box with groups - added items do not appear in the dropdown. I think in this situation a group should be added titled 'Miscellaneous' with custom items within it. I don't think this is a blocker though so i've merged this into version 2.8.0.

@zhanglun
Copy link

zhanglun commented Jun 7, 2018

Sorry guys, I can not find any code for this feature. 😣
Could anyone tell me how to set the configs to support add items for multi-select?

@jshjohnson
Copy link
Collaborator

@zhanglun This feature is no longer being actively worked on. To enable it requires a more fundamental refactor of Choices (which is in the pipeline)

@zhanglun
Copy link

zhanglun commented Jun 7, 2018

@jshjohnson
Thank you very much. I really look forward to the new version

@garyapps
Copy link

garyapps commented Jan 24, 2019

I am curious if this issue will ever be resolved. It is 2019, and the issue was raised in 2016. If there is a new version of Choices coming out, when will it release?

Also, I would suggest that until then this be listed as a limitation of the tool on the main page. I have wasted a significant amount of time integrating Choices.js into our UI, before discovering that there is no way to provide a list of tags (with -select- tag) and additionally also allow the user to add their own tags. Maybe other individuals can be saved from this frustration...

@mlshvdv
Copy link

mlshvdv commented Jan 25, 2019

Wow. I thought that the Choices have this feature. I need it too.

@mlshvdv
Copy link

mlshvdv commented Jan 25, 2019

I have wasted a significant amount of time integrating Choices.js into our UI, before discovering that there is no way to provide a list of tags (with ) and additionally also allow the user to add their own tags.

The same situation..

@kittee
Copy link

kittee commented Feb 20, 2019

I think I want to give a shot at making this work. I also want to use it for a project.

@tobias-kuendig
Copy link

For anyone looking for a good alternative that supports this feature see https://github.com/yairEO/tagify

@wgch
Copy link

wgch commented Mar 19, 2019

For anyone looking for a good alternative that supports this feature see https://github.com/yairEO/tagify

Works neat!

@GoldenMaximo
Copy link

Easy temporary workaround for anyone in need

It's not perfect and I don't actually recommend it but if you're in need/in a hurry - it's something.

@alvin
Copy link

alvin commented Oct 1, 2019

I have wasted a significant amount of time integrating Choices.js into our UI, before discovering that there is no way to provide a list of tags (with ) and additionally also allow the user to add their own tags.

^^ Ditto, quite surprising.

@GoldenMaximo
Copy link

I have wasted a significant amount of time integrating Choices.js into our UI, before discovering that there is no way to provide a list of tags (with ) and additionally also allow the user to add their own tags.

^^ Ditto, quite surprising.

I had found myself in the same situation. Check out the fix I made. It's been working fine in production since July.

@sevenpixels
Copy link

I would love to see this as an option.

@Sogl
Copy link

Sogl commented Dec 27, 2022

Still an issue in the end of 2022? OMG...

Today I discovered that this library does not support this function. 😢

@phonosys
Copy link

phonosys commented Jan 9, 2023

still not possible ? ;s

@djames004
Copy link

I know this is really old; however, I did come up with a solution today for my needs that was very simple. I needed a way for a user to type a client name and if our database had a match the user can select the client. If there is not a match, the user can choose what they've searched for as the client.

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

Successfully merging a pull request may close this issue.