diff --git a/app/components/UI/Input.js b/app/components/UI/Input.js index 9c30da16..f4b44e91 100644 --- a/app/components/UI/Input.js +++ b/app/components/UI/Input.js @@ -94,7 +94,7 @@ class Input extends React.Component { const { hasFocus } = this.state const { setValue, setTouched } = fieldApi const { value } = fieldState - const isValid = value && !fieldState.error + const isValid = value && !fieldState.error && !fieldState.asyncError && fieldState.touched // Calculate the border color based on the current field state. let borderColor @@ -102,7 +102,7 @@ class Input extends React.Component { borderColor = theme.colors.gray } else if (fieldState.error || fieldState.asyncError) { borderColor = theme.colors.superRed - } else if (value && (!fieldState.error && !fieldState.asyncError)) { + } else if (isValid) { borderColor = theme.colors.superGreen } diff --git a/app/components/UI/TextArea.js b/app/components/UI/TextArea.js index 0ed050ef..1e6052c8 100644 --- a/app/components/UI/TextArea.js +++ b/app/components/UI/TextArea.js @@ -72,7 +72,7 @@ class TextArea extends React.PureComponent { const { hasFocus } = this.state const { setValue, setTouched } = fieldApi const { value } = fieldState - const isValid = value && !fieldState.error + const isValid = value && !fieldState.error && !fieldState.asyncError && fieldState.touched // Calculate the border color based on the current field state. let borderColor @@ -80,7 +80,7 @@ class TextArea extends React.PureComponent { borderColor = theme.colors.gray } else if (fieldState.error || fieldState.asyncError) { borderColor = theme.colors.superRed - } else if (value && (!fieldState.error && !fieldState.asyncError)) { + } else if (isValid) { borderColor = theme.colors.superGreen }