           @_renderSearchRegion()
 
   _onTextareaChange: (text) ->
+    @setState(validComment: @_validComment(text))
     @setState(controlsOpened: true) if text.length > 0
 
   _onSearchInsert: (text) ->

  getInitialState: ->
    controlsOpened: false
    searchOpened: false

  _renderTextArea: ->
    ReactTextArea

    @setState searchOpened: false

  _submit: ->
    return unless @state.validComment

    @props.onSubmit? $.trim(@refs.textarea.getText())
    @setState @getInitialState()
    @refs.textarea.updateText ''

  _validComment: (text) ->
    comment = new Comment content: $.trim(text)
    comment.isValid()
