AutocompleteArrayInput allows to pick repeated values (probably a feature?)
See original GitHub issueimport { AutocompleteArrayInput } from 'react-admin';
<AutocompleteArrayInput source="category" choices={[
{ id: 'programming', name: 'Programming' },
{ id: 'lifestyle', name: 'Lifestyle' },
{ id: 'photography', name: 'Photography' },
]} />
Just use the example component. It allows to pick the same value twice. If you remove one of the repeated values, all of them are removed, so it looks like it probably doesn’t make sense to allow repeated values (bug).
If it does make sense, there should be an attribute to control whether we want repeated values or not (feature)?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to make AutocompleteArrayInput allow new values?
Some time ago I made a Select-component that can do this, if placed inside a component.
Read more >Find and remove duplicates - Microsoft Support
Find and remove duplicates · Select the cells you want to check for duplicates. · Click Home > Conditional Formatting > Highlight Cells...
Read more >React-admin - Field Components - Marmelab
Field Components. A Field component displays a given property of a record. Such components are used in the List and Show views, but...
Read more >How to Remove Duplicates from a Bigquery Table - Dataform
The best strategy for managing duplicate records is to use a SELECT query to augment the original structure, then save the results to...
Read more >How to find, manage and remove duplicates in Excel
1. How to identify duplicates ... The first tool is one of the options on the Conditional Formatting feature. As its name suggests,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m still waiting for a feedback on this merge request: https://github.com/marmelab/react-admin/pull/2912
@djhi, could you please take a look and tell us what is missing?
The method
handleSuggestionSelected
is adding the new value directly to theinput
throughonChange
method. Even when the propertyallowDuplicates
is enabled in theAutocompleteArrayInputChip
this element is added.A possible solution will be to add a new property to
AutocompleteArrayInput
component, namedallowDuplicates
, then check for this property before calling theinput.onChange
method.Here is my implementation, let me know if is fine for a merge request: https://github.com/tiagoschenkel/react-admin/commit/410943a7930f3db182747fff007bee92a0ea1064