bmcmahen / react-wysiwyg

retain some control over contenteditable input
169 stars 37 forks source link

Hitting Enter causes a loss of focus #36

Open Arcath opened 9 years ago

Arcath commented 9 years ago

As the title implies when I hit Enter a new paragraph is started but the editor loses focus and I have to click back in to it to keep typing.

My Editor line is:

React.createElement(ContentEditable, {tagName: 'div', onChange: @onTextChanged, html: @props.initialContent, editing: true})

and the onTextChanged handler is:

onTextChanged: (text, setPlaceholder, html) ->
    @setState {html: html}

    @props.onEditorChange(text)

and the onEditorChange function passed to class is:

editorChanged: (text) ->
    @setState {editorValue: text}
ghost commented 8 years ago

As i see in source currently the editor doesnt support multiline text. So you should realize the functionality urself or noLinebreaks prop in ContentEditable component.