Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/editor.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import assign from 'object-assign';
import blacklist from 'blacklist';
import React from 'react';
import ReactDOM from 'react-dom';

if (typeof document !== 'undefined') {
var MediumEditor = require('medium-editor');
Expand All @@ -21,12 +20,10 @@ export default class ReactMediumEditor extends React.Component {
}

componentDidMount() {
const dom = ReactDOM.findDOMNode(this);

this.medium = new MediumEditor(dom, this.props.options);
this.medium = new MediumEditor(this.dom, this.props.options);
this.medium.subscribe('editableInput', (e) => {
this._updated = true;
this.change(dom.innerHTML);
this.change(this.dom.innerHTML);
});
}

Expand All @@ -49,6 +46,7 @@ export default class ReactMediumEditor extends React.Component {
render() {
const tag = this.props.tag;
const props = blacklist(this.props, 'options', 'text', 'tag', 'contentEditable', 'dangerouslySetInnerHTML');
props.ref = node => this.dom = node

assign(props, {
dangerouslySetInnerHTML: { __html: this.state.text }
Expand Down