File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
packages/ra-ui-materialui/src/input/ArrayInput Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,44 @@ export const ReadOnly = () => (
173173 </ TestMemoryRouter >
174174) ;
175175
176+ export const DefaultValues = ( ) => (
177+ < TestMemoryRouter initialEntries = { [ '/books/1' ] } >
178+ < Admin dataProvider = { dataProvider } >
179+ < Resource
180+ name = "books"
181+ edit = { ( ) => {
182+ return (
183+ < Edit
184+ mutationMode = "pessimistic"
185+ mutationOptions = { {
186+ onSuccess : data => {
187+ console . log ( data ) ;
188+ } ,
189+ } }
190+ >
191+ < SimpleForm >
192+ < TextInput source = "title" />
193+ < ArrayInput source = "authors" >
194+ < SimpleFormIterator >
195+ < TextInput
196+ source = "name"
197+ defaultValue = "John Doe"
198+ />
199+ < TextInput
200+ source = "role"
201+ defaultValue = "Author"
202+ />
203+ </ SimpleFormIterator >
204+ </ ArrayInput >
205+ </ SimpleForm >
206+ </ Edit >
207+ ) ;
208+ } }
209+ />
210+ </ Admin >
211+ </ TestMemoryRouter >
212+ ) ;
213+
176214const BookEditWithAutocomplete = ( ) => {
177215 return (
178216 < Edit
You can’t perform that action at this time.
0 commit comments