Skip to content

Commit

Permalink
[no ci] minor improvements to story
Browse files Browse the repository at this point in the history
  • Loading branch information
slax57 committed Dec 17, 2024
1 parent 5d339c8 commit b05a1a0
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions packages/ra-ui-materialui/src/form/FormDataConsumer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ export const Basic = () => (
<FormDataConsumer<any>>
{({ formData }) => {
console.log({ formData });
if (!!formData.title) {
return (
<ReferenceInput
source="userId"
reference="users"
>
<AutocompleteInput
shouldUnregister
label="User"
optionText={choice =>
`${choice.name} / (${choice.id})`
}
// optionValue="userId"
noOptionsText="User does'nt exist"
isRequired
validate={[
required('User is Required.'),
]}
/>
</ReferenceInput>
);
} else return null;
if (!formData.title) {
return null;
}
return (
<ReferenceInput
source="userId"
reference="users"
>
<AutocompleteInput
shouldUnregister
label="User"
optionText={choice =>
`${choice.name} / (${choice.id})`
}
noOptionsText="User doesn't exist"
isRequired
validate={[
required('User is required.'),
]}
/>
</ReferenceInput>
);
}}
</FormDataConsumer>
<TextInput source="body" multiline rows={5} />
Expand Down

0 comments on commit b05a1a0

Please sign in to comment.