diff --git a/source/components/conversation/Input.js b/source/components/conversation/Input.js index e2caf023e..24ca2964a 100644 --- a/source/components/conversation/Input.js +++ b/source/components/conversation/Input.js @@ -6,7 +6,7 @@ import R from 'ramda' @FormDecorator('input') export default class Input extends Component { state = { - suggestedInput: false + hoverSuggestion: null } render() { let { @@ -19,8 +19,9 @@ export default class Input extends Component { answerSuffix = valueType.suffix, suffixed = answerSuffix != null, inputError = touched && error, + {hoverSuggestion} = this.state, sendButtonDisabled = - this.state.suggestedInput || !input.value || inputError + input.value == null || input.value == '' || inputError if (typeof suggestions == 'string') return @@ -84,11 +86,8 @@ export default class Input extends Component { key={value} onClick={e => setFormValue('' + value) && submit() && e.preventDefault()} - onMouseOver={() => - setFormValue('' + value) && - this.setState({ suggestedInput: true })} - onMouseOut={() => - setFormValue('') && this.setState({ suggestedInput: false })} + onMouseOver={() => this.setState({ hoverSuggestion: value })} + onMouseOut={() => this.setState({ hoverSuggestion: null })} style={{ color: themeColours.colour }} >