             <Panel style={background:color, wordWrap:"break-word", marginBottom: marginBottom, marginTop: marginTop, borderRadius: borderRadius}>
                 <ListGroup fill>
                     <ListGroupItem onDoubleClick={@edit_message} style={background:color, fontSize: font_size, borderRadius: borderRadius}>
-                        {@render_markdown(value) if not @state.show_edit_input}
-                        {@render_input() if @state.show_edit_input}
+                        {@render_markdown(value) if not @is_editing()}
+                        {@render_input() if @is_editing()}
                         {@editing_status() if @props.message.get('history').size > 1}
                         {@get_timeago()}
                     </ListGroupItem>

        if e.keyCode==27 # ESC
            e.preventDefault()
            @setState
                edited_message  : @newest_content()
                show_edit_input : false
            @props.actions.toggle_editing(@props.message, false)
        else if e.keyCode==13 and not e.shiftKey # 13: enter key
            mesg = @refs.editedMessage.getValue()
            if mesg != @newest_content()
                @props.actions.send_edit(@props.message, mesg)
            else
                @props.actions.toggle_editing(@props.message, false)
            @setState(show_edit_input:false)

    edit_message: ->
        @props.actions.toggle_editing(@props.message, true)
        @setState(show_edit_input:true)

    focus_endpoint: (e) ->
        val = e.target.value

               @props.is_prev_sender != next.is_prev_sender or
               @props.is_next_sender != next.is_next_sender or
               @props.editor_name != next.editor_name or
               @state.edited_message != next_state.edited_message
               ((not @props.is_prev_sender) and (@props.sender_name != next.sender_name))

    #componentWillUnmount: () ->
    #    @props.actions.set_editing(@props.message, false)

    newest_content: ->
        @props.message.get('history').peek().get('content') ? ''

    is_editing: ->
        @props.message.get('editing').includes(@props.account_id)

    sender_is_viewer: ->
        @props.account_id == @props.message.get('sender_id')
