Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 20382af

Browse files
committed
Let default happen when Form has an action prop set. Fixes #626 (temp patch - will be addressed in V2)
1 parent d52da6a commit 20382af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/form-component.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ const propTypes = {
4848
onChange: PropTypes.func,
4949
getRef: PropTypes.func,
5050
getDispatch: PropTypes.func,
51+
52+
// standard HTML attributes
53+
action: PropTypes.string,
5154
};
5255

5356
const defaultStrategy = {
@@ -326,7 +329,7 @@ function createFormClass(s = defaultStrategy) {
326329
}
327330

328331
handleSubmit(e) {
329-
if (e) e.preventDefault();
332+
if (e && !this.props.action) e.preventDefault();
330333

331334
const {
332335
model,

0 commit comments

Comments
 (0)