Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit f1d90e4

Browse files
author
Dominik Sumer
committed
added onvalidchanged event
1 parent 54bd4e0 commit f1d90e4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Form.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,18 @@ export default class Form extends React.Component {
168168
if (this.props.onValid) {
169169
this.props.onValid(this.getValues());
170170
}
171+
if (this.props.onValidChanged) {
172+
this.props.onValidChanged(true, this.getValues());
173+
}
171174
}
172175

173176
onInvalid() {
174177
if (this.props.onInvalid) {
175178
this.props.onInvalid(this.getValues(), this.isValidating());
176179
}
180+
if (this.props.onValidChanged) {
181+
this.props.onValidChanged(false, this.getValues(), this.isValidating());
182+
}
177183
}
178184

179185
getValues() {
@@ -216,6 +222,7 @@ Form.propTypes = {
216222
onSubmit: PropTypes.func,
217223
onValidSubmit: PropTypes.func,
218224
onInvalidSubmit: PropTypes.func,
225+
onValidChanged: PropTypes.func,
219226
onValid: PropTypes.func,
220227
onInvalid: PropTypes.func
221228
};

0 commit comments

Comments
 (0)