-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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 allowDuplicates property to AutocompleteArrayInput and fix #2311 #2912
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 👍 Would you mind adding some tests though ?
Hi @djhi, I could write some unit tests, but this would take more time. Do you have in mind any specific test case? For me is not 100% clear yet if this Yes, I'm adding a new property thinking about keeping backward compatibility, but them this flag should be disabled by default since the current behavior of the My question is, does it make sense to add a new flag as a feature? Or should be the case that this is not intended behavior, then we should handle this as a Got it? Best! |
That it allows or not allows duplicates depending on the
I'm sure there are cases where you want to allow duplicates so I think it's good to have a flag and it should be false by default |
I'm trying to simulate an I'm not able to force a My last two test cases are incomplete even when they are passing. Could you help with this? |
Superseded by #4026 |
The method
handleSuggestionSelected
is adding the new value directly to theinput
throughonChange
method. Even when the propertyallowDuplicates
is enabled in theAutocompleteArrayInputChip
this element will be added.This merge request adds a new property to
AutocompleteArrayInput
component, namedallowDuplicates
, that is used to allow or disallow insertion of duplicated elements.Fixes #2311