-
Notifications
You must be signed in to change notification settings - Fork 42
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
Adding a custom value to a multi-select #64
Comments
@edeesis Hi! I can add an event like an
You will can process the Currently, It is just an idea. What do you think about it? |
Yeah, that would make sense to me. It's surprising to me how many typeahead/select2 implementations there are out there and none of them allow you to add a custom value. What you're proposing makes perfect sense to me, you would just subscribe to that event and add it to the array. I assume it would also clear the input box like selecting an item from the dropdown does |
There are two ways:
Second way easiest for me. But I am not sure that it will use. |
Hi @optimistex , I was looking for similar functionality and modified the inputKeyUp event to push custom item when the item does not exist in the options array. This feature works only when @input binding is defined on the component. |
@ahmdrami It is similar to my idea but from outside. My idea is to do it from inside. |
@optimistex |
Hi @optimistex, Thank you for the component. We have "custom value" use case too, but for the single select mode. I will help or implement the feature but I would be happy if we can agree in the solution before I start the implementation. The use case:
If the user type
The options list will contains 2 new item The #193 PR contains the implementation of the multi select way. But it does not support the custom validator and pending for a while. I am open to implement any other solution that cover our use case. |
@ert78gb First of all I have to point that there is a similar component with necessary feature: https://ng-select.github.io/ng-select#/tags We have two ways:
In case you choose the option #2 I like this approach: https://stackblitz.com/run?file=src/tags-custom-example.component.html |
@optimistex Sorry for the late response but we switched to the |
Is there anyway to add a custom value to a multi-select? So the user can type whatever they want, not necessarily what's available in the list passed to the component?
The text was updated successfully, but these errors were encountered: