-
Notifications
You must be signed in to change notification settings - Fork 617
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 user-created choices for selects #525
Conversation
I have rebased with master to fix merge conflicts since I opened this PR, added tests, added a gif demo, and updated the readme. Please let me know if there's anything else I can address so this can be considered for merging. ✧・゚:*╰(◕‿◕。╰) |
Is there any chance that this feature could be added? |
Sorry, I've been really busy recently. Will get this reviewed and merged ASAP |
Hi, just wondering if/when this will be reviewed and merged? Very keen on using this feature :) |
@caramiki @jshjohnson guys any news about this amazing feature? thanks |
Is there anything we can do to help with getting this feature added? |
Please add this. I had to develop it on my own. Ended up with a makeshift workaround code.
Edit: I've just now realized I forgot to change the "No results found" caption to "Press enter to add" like the OP |
I don't know if this issue has been fixed already or if you were using the code I've made but my fix is pretty modifiable and it's working fine in production, I'm pretty sure you can come up with a reasonable solution based on it. |
I tried to use the pull request implementation, not yours. That'll be the next step for me ;) ... Few moments later: @GoldenMaximo: Your implementation feels more like what I would expect. |
I agree this is counterintuitive - a solution to add choices dynamically needs to be able to differentiate between selecting an existing choice and adding a non-existent choice |
Hi! Is there any update about this feature? Thanks |
Hi @GoldenMaximo , I am trying your workaround but I get |
You may have to use an older Version of this library to use the exact code example. I can confirm, that it worked for me, but back then choices.js was at version 7.x.x 6 months ago, now it is at 9.x.x. |
Thanks @BlaM . I ended up using Tagify for tags. |
why is a new option introduced? Edit: I misunderstood the addItems flag |
I reworked this PR and made an other PR: There are many edge cases which need to be handled (like disabled options). |
I'm confused, isn't this in the demo? Look at the first example here https://joshuajohnson.co.uk/Choices/ Is or isn't this actually supported? |
Ok sorry, I understand now. Adding new elements only works for |
Excuse me, when is this feature implemented ? I want to use this feature in my project. Can you implement this feature soon, please ? Thanks. |
Please, I'm waiting for this feature too. I would like to keep using this awesome select box, but I need to add the user input when it's a select. |
I think we need this feature for single select too, not just on |
Like @rizkhal, I really need this feature in single select. Any news on when and if this will be merged? How can i help in speeding up this MR? |
Sadly, this PR would need to be completely redone. This library has been completely revamped into TS. Merging this PR isn't possible without redoing most of it. |
I re-implemented this PR under the new code base. #1117 |
@GoldenMaximo I like the workaround you've come out with. Will it be possible that you can share the full example as I'm newbie to javascript and not sure where should I include the "const choicesIssue39Fix" you've developed. Much Appreciated! |
Waiting for this feature, are there any updates ? |
Thank you for your perfect implementation, and I hope the author can merge as soon as possible. |
Made my own implementation (read: hack)
|
This feature will be implemented as part of #1166, there was a lot of subtle complexity around how notices where displayed which where not captured in this PR |
Description
addChoices
which affects selects. It is false by default to maintain old behavior.addChoices
is set to true, the user can type an option into the field and press enter, and it will be added as a new option and selected.Motivation and Context
This addresses #39 which is allowing users to add choices to selects.
How Has This Been Tested?
It works on the project I'm working on. The existing tests and new tests that I added pass.
Screenshots (if appropriate):
Types of changes
Checklist: