ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
29.97k stars 3.25k forks source link

renderEditor only works in plugin, not in Editor #1841

Closed klis87 closed 6 years ago

klis87 commented 6 years ago

Do you want to request a feature or report a bug?

Potential bug or not update doc

What's the current behavior?

renderEditor doesn't work when defined as Editor prop, only as plugin. See https://jsfiddle.net/fj9dvhom/352/

What's the expected behavior?

renderEditor should be added to implicit editor plugin and called, currently it is ignored

luolonghao commented 6 years ago

these tags of Toolbar should be inserted before Editor.

render() {
    return (
        <div>
        <div>Toolbar</div>
        <Editor
          placeholder="Enter some text"
          onChange={change => this.onChange(change)}
          value={this.state.value}
        />
      </div>
    )
  }
klis87 commented 6 years ago

I could, but then I wont have access to editor related props, and anyway according to docs using renderEditor should be possible - see https://docs.slatejs.org/guides/rendering#the-editor-itself

Currently I mitigate the issue by putting this inside a plugin