You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/AutocompleteArrayInput.md
+28-25
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ The list of choices must be an array of objects - one object for each possible c
85
85
]} />
86
86
```
87
87
88
-
You can also use an array of objects with different properties for the label and value, given you specify the `optionText` and `optionValue` props:
88
+
You can also use an array of objects with different properties for the label and value, given you specify the [`optionText`](#optiontext) and [`optionValue`](#optionvalue) props:
To allow users to add new options, pass a React element as the `create` prop. `<AutocompleteArrayInput>` will then render a menu item at the bottom of the list, which will render the passed element when clicked.
132
+
To allow users to add new options, pass a React element as the `create` prop. `<AutocompleteArrayInput>` will then render a "Create" option at the bottom of the choices list. When clicked, it will render the create element.
If you just need to ask users for a single string to create the new option, you can use [the `onCreate` prop](#oncreate) instead.
203
204
205
+
If you're in a `<ReferenceArrayInput>` or `<ReferenceManyToManyInput>`, the `handleSubmit` will need to create a new record in the related resource. Check the [Creating New Choices](#creating-new-choices) for an example.
206
+
204
207
## `debounce`
205
208
206
209
When used inside a [`<ReferenceArrayInput>`](./ReferenceArrayInput.md), `<AutocompleteArrayInput>` will call `dataProvider.getList()` with the current input value as filter after a delay of 250ms. This is to avoid calling the API too often while users are typing their query.
0 commit comments