diff --git a/lib/components/content.js b/lib/components/content.js index 1df2605a7..0ae6da247 100644 --- a/lib/components/content.js +++ b/lib/components/content.js @@ -37,6 +37,7 @@ class Content extends React.Component { className: React.PropTypes.string, editor: React.PropTypes.object.isRequired, onBeforeInput: React.PropTypes.func.isRequired, + onBlur: React.PropTypes.func.isRequired, onChange: React.PropTypes.func.isRequired, onKeyDown: React.PropTypes.func.isRequired, onPaste: React.PropTypes.func.isRequired, @@ -153,7 +154,9 @@ class Content extends React.Component { onBeforeInput = (e) => { if (this.props.readOnly) return - this.props.onBeforeInput(e) + + const data = {} + this.props.onBeforeInput(e, data) } /** diff --git a/lib/plugins/core.js b/lib/plugins/core.js index cc5e0642b..d419f5d79 100644 --- a/lib/plugins/core.js +++ b/lib/plugins/core.js @@ -70,12 +70,13 @@ function Plugin(options = {}) { * input behavior, to avoid a re-render for performance. * * @param {Event} e + * @param {Object} data * @param {State} state * @param {Editor} editor * @return {State} */ - function onBeforeInput(e, state, editor) { + function onBeforeInput(e, data, state, editor) { const { renderDecorations } = editor const { startOffset, startText, startBlock } = state