From c958023b975456ece642233a75d9bf14d766e9b6 Mon Sep 17 00:00:00 2001 From: Xia Amendolara Date: Wed, 20 Sep 2017 09:29:43 -0700 Subject: [PATCH] add form clearing for params keys, bug fix. Issues #27 --- app/src/scripts/common/forms/input.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/scripts/common/forms/input.jsx b/app/src/scripts/common/forms/input.jsx index 3ba46c0d16..3575d22dcf 100644 --- a/app/src/scripts/common/forms/input.jsx +++ b/app/src/scripts/common/forms/input.jsx @@ -14,6 +14,13 @@ let Input = React.createClass({ }; }, + componentWillReceiveProps(nextProps) { + // Will reset value when prop changes + if ('value' in nextProps) { + this.setState({value: nextProps.value}) + } + }, + propTypes: { initialValue: React.PropTypes.string, placeholder: React.PropTypes.string, @@ -22,7 +29,7 @@ let Input = React.createClass({ value: React.PropTypes.string, onChange: React.PropTypes.func, disabled: React.PropTypes.bool, - checekd: React.PropTypes.bool + checked: React.PropTypes.bool }, render() {