git.wincent.com
/
hextrapolate.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50dce6a
)
Only replace validators when base changes
author
Greg Hurrell <greg@hurrell.net>
Thu, 1 Jun 2017 14:05:06 +0000
(07:05 -0700)
committer
Greg Hurrell <greg@hurrell.net>
Thu, 1 Jun 2017 14:05:06 +0000
(07:05 -0700)
Which is rare (only when user selects a new one from one of the dynamic
field drop-downs).
src/Field.react.js
patch
|
blob
|
history
diff --git
a/src/Field.react.js
b/src/Field.react.js
index b7b3ebda775f8d20bf2437f2664d98682d518de0..4b1fa4a7b5c6ac49228daba36b60dbef3d726fed 100644
(file)
--- a/
src/Field.react.js
+++ b/
src/Field.react.js
@@
-63,7
+63,9
@@
export default class Field extends React.Component {
}
componentWillReceiveProps(nextProps) {
- this._validator = getValidator(nextProps.base);
+ if (nextProps.base !== this.props.base) {
+ this._validator = getValidator(nextProps.base);
+ }
}
_isValid(value: string): boolean {