bmcmahen / react-wysiwyg

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

Element not focusing when editing is set to true #21

Closed CoreyTrombley closed 9 years ago

CoreyTrombley commented 9 years ago

also when I set the focus within:

  enableEditing: function(){
    // set your contenteditable field into editing mode.
    this.setState({ editing: true });
  }

it will focus the begining of the input regardless of the current value.

bmcmahen commented 9 years ago

Yeah, you need to manually focus the element yourself. You can use the following methods:

this.refs.editable.autofocus()

this.refs.editable.setCursorToStart()

this.refs.editable.setCursorToEnd()