From 647ba8d114f7c5b0cb468e26d060646b91dcb8db Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Mon, 11 Dec 2017 18:52:47 -0700 Subject: [PATCH] Add helpText and fix onInput() in LargeTextArea --- .../management/LargeTextArea/index.jsx | 50 ++++++++----------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/src/components/management/LargeTextArea/index.jsx b/src/components/management/LargeTextArea/index.jsx index 4c36415..ca4df5a 100644 --- a/src/components/management/LargeTextArea/index.jsx +++ b/src/components/management/LargeTextArea/index.jsx @@ -10,6 +10,11 @@ export class LargeTextArea extends Component { PropTypes.checkPropTypes({ label: PropTypes.string.isRequired, + helpText: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.object, + PropTypes.array, + ]), value: PropTypes.string.isRequired, placeholder: PropTypes.string, isValid: PropTypes.bool, @@ -45,19 +50,19 @@ export class LargeTextArea extends Component { } onInput (event) { - const val = event.currentTarget.value; + const val = event.target.value; if (val !== this.state.value) { this.setState({ value: val }, () => { if (this.props.onInput) { - this.props.onInput(this.state.value); + this.props.onInput(event); } }); } } renderTextarea () { - const { placeholder, isValid, onChange } = this.props; + const { placeholder, isValid = true, onChange } = this.props; return (