1

I am using react-admin for my application. I want to create a searchable(suggesting with possible values) multi-select field input which fetches data(feature name in my case from table features) which can be selected from a table at the backend. My current code looks like this: `

    export default class ModelCreate extends React.Component<any, any> {
        return (
                    <Create title="Create a Model" {...this.props}>
                        <SimpleForm className="model-container" toolbar={<ModelCreateToolbar />}>

                            <SelectInput
                                source="group"
                                label="Group"
                                choices={GROUP}
                                optionText="name"
                                optionValue="group"
                                style={styles}
                                validate={validateField}
                                required
                            />
                            <ReferenceArrayInput source="id" reference="features">
                                   <SelectArrayInput source="name" reference="features" label="feature" required />
                            </ReferenceArrayInput>
                        </SimpleForm>
                   </Create>
            );
        }
    }

`

In this code feature is my table name which has entries of id and name.

P.S: I'm using typescript.

Anirudh Sharma
  • 129
  • 1
  • 3
  • 9

1 Answers1

0

You mean something like the AutocompleteInput we had in admini-on-rest?

If yes, we chose to remove it from the core as the Autocomplete is not provided by material-ui v1 anymore. This means you'll have to implement your own using something like material-ui-chip-input and downshift.

I know someone is working on a react-admin addon for this input. No ETA yet though

Gildas Garcia
  • 6,966
  • 3
  • 15
  • 29