Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Nov 2, 2022
1 parent 45d4fc2 commit e0469b9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 41 deletions.
2 changes: 1 addition & 1 deletion docs/DualListInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const choices = possibleValues.map(value => ({ id: value, name: ucfirst(value) }

## `disableValue`

By default, `<DualListInput>` renders the choices with the field `disabled: true` as disabled.
By default, `<DualListInput>` renders the choices with the field `disabled` as disabled.

```jsx
const choices = [
Expand Down
17 changes: 0 additions & 17 deletions docs/ReferenceArrayInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ See the [`children`](#children) section for more details.
| `label` | Optional | `string` | - | Useful only when `ReferenceArrayInput` is in a Filter array, the label is used as the Filter label. |
| `page` | Optional | `number` | 1 | The current page number |
| `perPage` | Optional | `number` | 25 | Number of suggestions to show |
| `queryOptions` | Optional | [`UseQuery Options`](https://tanstack.com/query/v4/docs/reference/useQuery?from=reactQueryV3&original=https://react-query-v3.tanstack.com/reference/useQuery)| `{}` | `react-query` client options |
| `sort` | Optional | `{ field: String, order: 'ASC' or 'DESC' }` | `{ field: 'id', order: 'DESC' }` | How to order the list of suggestions |

**Note**: `<ReferenceArrayInput>` doesn't accept the [common input props](./Inputs.md#common-input-props) ; it is the responsability of children to apply them.
Expand Down Expand Up @@ -271,22 +270,6 @@ You can override this default by specifying the `optionText` prop in the child c
</ReferenceArrayInput>
```

## `queryOptions`

Use the `queryOptions` prop to pass options to the `dataProvider.getList()` query that fetches the possible choices.

For instance, to pass [a custom `meta`](./Actions.md#meta-parameter):

{% raw %}
```jsx
<ReferenceArrayInput
source="tag_ids"
reference="tags"
queryOptions={{ meta: { foo: 'bar' } }}
/>
```
{% endraw %}

## `sort`

By default, `<ReferenceArrayInput>` orders the possible values by `id` desc.
Expand Down
23 changes: 0 additions & 23 deletions packages/ra-ui-materialui/src/input/SelectArrayInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,26 +99,3 @@ export const CreateProp = () => (
</Create>
</AdminContext>
);

export const EmptyText = () => (
<AdminContext i18nProvider={i18nProvider}>
<Create
resource="users"
record={{ roles: ['u001', 'u003'] }}
sx={{ width: 600 }}
>
<SimpleForm>
<SelectArrayInput
source="roles"
choices={[
{ id: 'admin', name: 'Admin' },
{ id: 'u001', name: 'Editor' },
{ id: 'u002', name: 'Moderator' },
{ id: 'u003', name: 'Reviewer' },
]}
sx={{ width: 300 }}
/>
</SimpleForm>
</Create>
</AdminContext>
);

0 comments on commit e0469b9

Please sign in to comment.