react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

Don't clear filter text on `AutocompleteArrayInput` after selection has been made

Open yoitsro opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. When selecting options from the AutocompleteArrayInput component, as with a SelectArrayInput, I may want to select multiple options at once without the selection options disappearing and without the filter text being cleared after a selection is made.

A SelectArrayInput is not a feasible solution in this case because the selection options are being populated via a ReferenceArrayInput.

Describe the solution you'd like It should be possible for this behaviour to be enabled when required via setting a prop such as clearsFilterUponSelection={false}.

Describe alternatives you've considered I've looked through the source code and this functionality doesn't look immediately possible using any of the existing props. An alternative would be to create a brand new component, but it would largely have the same functionality as the existing component.

Additional context None.

yoitsro avatar Jul 07 '22 10:07 yoitsro

IMHO AutocompleteArrayInput is suited for for the most common cases, adding more options to it would complicate an already quite bloated component. I tend to think that such a behaviour should be extended in userland. Will be discussed with the core team though!

antoinefricker avatar Jul 08 '22 21:07 antoinefricker

I agree, this isn't something we'll implement in the core package. You can write your own AutocompleteArrayInput to replace react-admin's component for your use case.

fzaninotto avatar Oct 20 '22 09:10 fzaninotto