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/ReferenceManyField.md
+16
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,7 @@ This example leverages [`<SingleFieldList>`](./SingleFieldList.md) to display an
111
111
|`pagination`| Optional |`Element`| - | Pagination element to display pagination controls. empty by default (no pagination) |
112
112
|`perPage`| Optional |`number`| 25 | Maximum number of referenced records to fetch |
113
113
|`sort`| Optional |`{ field, order }`|`{ field: 'id', order: 'DESC' }`| Sort order to use when fetching the related records, passed to `getManyReference()`|
114
+
|`debounce`| Optional |`number`| 500 | debounce time in ms for the `setFilters` callbacks |
114
115
115
116
`<ReferenceManyField>` also accepts the [common field props](./Fields.md#common-field-props), except `emptyText` (use the child `empty` prop instead).
By default, `<ReferenceManyField>` does not refresh the data as soon as the user enters data in the filter form. Instead, it waits for half a second of user inactivity (via `lodash.debounce`) before calling the `dataProvider` on filter change. This is to prevent repeated (and useless) calls to the API.
179
+
180
+
You can customize the debounce duration in milliseconds - or disable it completely - by passing a `debounce` prop to the `<ReferenceManyField>` component:
181
+
182
+
```jsx
183
+
// wait 1 seconds instead of 500 milliseconds before calling the dataProvider
184
+
constPostCommentsField= () => (
185
+
<ReferenceManyField debounce={1000}>
186
+
...
187
+
</ReferenceManyField>
188
+
);
189
+
```
190
+
175
191
## `filter`
176
192
177
193
You can filter the query used to populate the possible values. Use the `filter` prop for that.
0 commit comments