fixes error state in textarea

This commit is contained in:
James
2018-11-06 09:05:14 -05:00
parent 3d79f47cec
commit 387065ed75
2 changed files with 5 additions and 3 deletions

View File

@@ -55,11 +55,13 @@ class Textarea extends Component {
? this.props.context.fields[this.props.name].valid
: true;
const showError = valid === false && this.props.context.submitted;
const Required = this.props.required
? () => <span className="required">*</span>
: () => null;
let Error = valid === false && this.props.context.submitted
let Error = showError
? () => <Tooltip className="error-message">{this.errors.text}</Tooltip>
: () => null;
@@ -68,7 +70,7 @@ class Textarea extends Component {
: () => null;
let className = 'interact textarea';
className = this.props.valid !== false ? className : `${className} error`;
className = !showError ? className : `${className} error`;
let style = this.props.style
? this.props.style

View File

@@ -32,7 +32,7 @@
&.error {
textarea {
border: 2px solid $pink;
background-color: lighten($pink, 15%);
}
}