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

Add support for adding user created items to select boxes #856

Closed
wants to merge 8 commits into from

Conversation

devkral
Copy link

@devkral devkral commented Apr 16, 2020

Fixes #39
This PR adds support for adding user created items to select boxes.
It reuses the addItems Flag for streamlining its behaviour for all supported elements (text, select, multi-select).

I would consider it as a breaking change for select boxes (fixable with addItems: false).

@devkral
Copy link
Author

devkral commented Apr 16, 2020

There is one missing part: the uniqueText doesn't show up with select boxes, but the creation is correctly prevented

@devkral
Copy link
Author

devkral commented Apr 20, 2020

unique message for multi-select boxes is now fixed

@juanmiguelbesada
Copy link

juanmiguelbesada commented Apr 21, 2020

Choice and Change events do not fire when new item is created and selected. Also, if using placeholder and single-select some times when the new item is selected, placeholder is shown

@devkral
Copy link
Author

devkral commented Apr 21, 2020 via email

@juanmiguelbesada
Copy link

atm I have tested change and choice events on a single-select type

@filotronik
Copy link

How do I initialize this? It doesnt work when I pass "addItems:true" to the choices object.

Copy link

@nikkii94 nikkii94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you merge this PR please? We already been using this since months, and its working fine for us. :)

@helenatxu
Copy link

Can you tell me, which events are affected? This would help me, fixing the error. Anyway: if somebody needs this feature urgent, he can add in package.json: ... "choices.js": "devkral/Choices#feature/add_select_options" ...

Hello @devkral , I'm trying your solution. How can I deactivate the addItemText option? I have more than one select on my page and it's always activated no matter what. Even I don't specify that option.

@kevinleto-informaticon
Copy link

I hope this feature will be merged in a short time 🙏
It would be really helpful ❗

@alejandrotrevi
Copy link

+1 For merging this feature if we can help with anything let us know @mtriff

@marcusjfloyd
Copy link

I ended up using @devkral's fork. I wish it would disable addItems by default for selects.

Still, going back and setting addItems to false in my project is a small price to pay compared to switching out for a whole new library.

Thanks for the good work @devkral +1

@Sogl
Copy link

Sogl commented Dec 27, 2022

Why this thing isn't merged yet? 🤔

@duhamaher
Copy link

any updates?? this feature is needed

@devkral
Copy link
Author

devkral commented Jul 25, 2023

I switched to react mui and were busy, so there were no updates. I think I try to rebase but I am out of the code for years.

@devkral devkral force-pushed the feature/add_select_options branch from 327faff to 774eee1 Compare July 25, 2023 10:00
@Ikpixel
Copy link

Ikpixel commented Jan 29, 2024

@devkral I am new to this but I used your pull request file via the zip and it works fine. But I found some issues.

  • When I start typing I can add the typed text by enter but when I type and see the option that I want I don't have the accessibility to use the keyboard keys to select the option, I need to remove everything I time and then I can navigate to the option by keyboard.

  • When I am on my IOS device and focused on the input search field I get the keyboard with a search key right at the bottom. Would be better to get the keyboard with the Return key right at the bottom. Maybe change the input tag to a textarea??

@cubode
Copy link

cubode commented Mar 4, 2024

@devkral this feature would be essential for the library to remain competitive with other options like tagify, do you think you would be able to merge it?

@devkral
Copy link
Author

devkral commented Mar 6, 2024

I have no permission to merge. What would you need to merge?

@devkral
Copy link
Author

devkral commented Mar 6, 2024

Anyway the PR is so old, that the project for which I required the PR is dead. Therefor I didn't developed the patch further but if you can tell me what you need I will try to find some time

@cubode
Copy link

cubode commented Mar 7, 2024

Thank you very much @devkral it would be basically to have the possibility to add new choices dynamically throuhg the text box. I am not sure why that feature is still not implemented in choices-js, who is the main maintainer?

@Xon
Copy link
Collaborator

Xon commented Aug 6, 2024

Thanks! I've implemented a variant of this in #1166 I'll likely copy out the tests to help verify the feature

@Xon
Copy link
Collaborator

Xon commented Aug 22, 2024

Most of these tests should be part of #1166

@Xon Xon closed this Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User add item & multi-select