This repository was archived by the owner on Aug 23, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -231,5 +231,17 @@ _(Function)_ Provides the dispatcher for the `<Form>`'s store.
231
231
/ >
232
232
```
233
233
234
+ ## ` onBeforeSubmit={(event) => ...} `
235
+ _ (Function)_ Called every time a ` submit ` event is emitted from the form.
236
+
237
+ (since: 1.6.1 - note: this is temporary and likely to be removed in version 2.0)
238
+
239
+ ``` jsx
240
+ < Form
241
+ model= " user"
242
+ onBeforeSubmit= {(event ) => /* ... */ }
243
+ / >
244
+ ```
245
+
234
246
### Notes
235
247
- This is most useful for use with ` <LocalForm> ` , and is primarily intended for ` <LocalForm> ` .
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ const propTypes = {
47
47
onChange : PropTypes . func ,
48
48
getRef : PropTypes . func ,
49
49
getDispatch : PropTypes . func ,
50
+ onBeforeSubmit : PropTypes . func ,
50
51
51
52
// standard HTML attributes
52
53
action : PropTypes . string ,
@@ -337,8 +338,11 @@ function createFormClass(s = defaultStrategy) {
337
338
formValue,
338
339
onSubmit,
339
340
validators,
341
+ onBeforeSubmit,
340
342
} = this . props ;
341
343
344
+ if ( onBeforeSubmit ) onBeforeSubmit ( e ) ;
345
+
342
346
const formValid = formValue
343
347
? formValue . $form . valid
344
348
: true ;
You can’t perform that action at this time.
0 commit comments