1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 20:51:20 +02:00

Add div to editor as editor.el (#2820)

This commit is contained in:
Sunny Hirai
2019-05-22 11:26:11 -07:00
committed by Ian Storm Taylor
parent d7b37a8dca
commit accba53f56

View File

@@ -111,6 +111,17 @@ class Content extends React.Component {
ref = React.createRef()
/**
* Set both `this.ref` and `editor.el`
*
* @type {DOMElement}
*/
setRef = el => {
this.ref.current = el
this.props.editor.el = el
}
/**
* Create a set of bound event handlers.
*
@@ -506,7 +517,7 @@ class Content extends React.Component {
key={this.props.contentKey}
{...handlers}
{...data}
ref={this.ref}
ref={this.setRef}
contentEditable={readOnly ? null : true}
suppressContentEditableWarning
id={id}