         @props.text
 
 commentsList = React.createClass
+  componentDidUpdate: ->
+    node = @getDOMNode()
+    node.scrollTop = node.scrollHeight
+
   render: ->
     nodes = @props.comments.map (c) ->
       comment(c)

      dataType: 'json'
      success: (comments) =>
        @setState {comments: comments}
        console.log comments[0]
      error: -> console.error "error"
    )
  getInitialState: ->
    {comments: []}
  componentWillMount: ->
    @loadComments()
  submit: (comment) ->
    comments = @state.comments
    comment.name = @props.name

    @props.submit {text: text.state.value}
    text.getDOMNode().value = ""
    false

  render: ->
    form className: "comment-form", onSubmit: @submit,
      input type: "text", ref: "text"
