Skip to content

Commit 03fb046

Browse files
committed
add autoFocus
1 parent 9705dac commit 03fb046

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/AutocompleteInput.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ const BookCreate = () => (
161161
<ReferenceInput reference="authors" source="author">
162162
<AutocompleteInput
163163
create={<CreateAuthor />}
164-
optionText="name"
165164
/>
166165
</ReferenceInput>
167166
</SimpleForm>
@@ -214,7 +213,7 @@ const CreateAuthor = () => {
214213
>
215214
<SimpleForm defaultValues={{ name: filter }}>
216215
<TextInput source="name" helperText={false} />
217-
<TextInput source="language" helperText={false} />
216+
<TextInput source="language" helperText={false} autoFocus />
218217
</SimpleForm>
219218
</CreateBase>
220219
</DialogContent>

packages/ra-ui-materialui/src/input/AutocompleteInput.stories.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,11 @@ const CreateAuthor = () => {
862862
>
863863
<SimpleForm defaultValues={{ name: filter }}>
864864
<TextInput source="name" helperText={false} />
865-
<TextInput source="language" helperText={false} />
865+
<TextInput
866+
source="language"
867+
helperText={false}
868+
autoFocus
869+
/>
866870
</SimpleForm>
867871
</CreateBase>
868872
</DialogContent>
@@ -881,10 +885,7 @@ const BookEditWithReferenceAndCreationSupport = () => (
881885
>
882886
<SimpleForm>
883887
<ReferenceInput reference="authors" source="author">
884-
<AutocompleteInput
885-
create={<CreateAuthor />}
886-
optionText="name"
887-
/>
888+
<AutocompleteInput create={<CreateAuthor />} />
888889
</ReferenceInput>
889890
</SimpleForm>
890891
</Edit>

0 commit comments

Comments
 (0)