File tree 1 file changed +12
-4
lines changed
packages/ra-ui-materialui/src/form
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,10 @@ const Toolbar: FC<ToolbarProps> = props => {
161
161
Children . map ( children , ( button : ReactElement ) =>
162
162
button && isValidElement < any > ( button )
163
163
? React . cloneElement ( button , {
164
- basePath,
164
+ basePath : valueOrDefault (
165
+ button . props . basePath ,
166
+ basePath
167
+ ) ,
165
168
handleSubmit : valueOrDefault (
166
169
button . props . handleSubmit ,
167
170
handleSubmit
@@ -173,8 +176,14 @@ const Toolbar: FC<ToolbarProps> = props => {
173
176
onSave : button . props . onSave ,
174
177
invalid,
175
178
pristine,
176
- record,
177
- resource,
179
+ record : valueOrDefault (
180
+ button . props . record ,
181
+ record
182
+ ) ,
183
+ resource : valueOrDefault (
184
+ button . props . resource ,
185
+ resource
186
+ ) ,
178
187
saving,
179
188
submitOnEnter : valueOrDefault (
180
189
button . props . submitOnEnter ,
@@ -184,7 +193,6 @@ const Toolbar: FC<ToolbarProps> = props => {
184
193
button . props . undoable ,
185
194
undoable
186
195
) ,
187
- ...button . props ,
188
196
} )
189
197
: null
190
198
)
You can’t perform that action at this time.
0 commit comments