|
@@ -75,6 +75,10 @@ class Form<Values extends Record<string, any> = any> extends BaseComponent<BaseF
|
|
|
style: PropTypes.object,
|
|
style: PropTypes.object,
|
|
|
showValidateIcon: PropTypes.bool,
|
|
showValidateIcon: PropTypes.bool,
|
|
|
stopValidateWithError: PropTypes.bool,
|
|
stopValidateWithError: PropTypes.bool,
|
|
|
|
|
+ stopPropagation: PropTypes.shape({
|
|
|
|
|
+ submit: PropTypes.bool,
|
|
|
|
|
+ reset: PropTypes.bool,
|
|
|
|
|
+ }),
|
|
|
id: PropTypes.string,
|
|
id: PropTypes.string,
|
|
|
wrapperCol: PropTypes.object, // Control wrapperCol {span: number, offset: number} for all field child nodes
|
|
wrapperCol: PropTypes.object, // Control wrapperCol {span: number, offset: number} for all field child nodes
|
|
|
trigger: PropTypes.oneOfType([
|
|
trigger: PropTypes.oneOfType([
|
|
@@ -240,11 +244,17 @@ class Form<Values extends Record<string, any> = any> extends BaseComponent<BaseF
|
|
|
|
|
|
|
|
submit(e: React.FormEvent<HTMLFormElement>) {
|
|
submit(e: React.FormEvent<HTMLFormElement>) {
|
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
|
|
+ if (this.props.stopPropagation && this.props.stopPropagation.submit) {
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
|
+ }
|
|
|
this.foundation.submit(e);
|
|
this.foundation.submit(e);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
reset(e: React.FormEvent<HTMLFormElement>) {
|
|
reset(e: React.FormEvent<HTMLFormElement>) {
|
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
|
|
|
+ if (this.props.stopPropagation && this.props.stopPropagation.reset) {
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
|
+ }
|
|
|
this.foundation.reset();
|
|
this.foundation.reset();
|
|
|
}
|
|
}
|
|
|
|
|
|