diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-01-16 07:59:03 -0500 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-01-16 07:59:03 -0500 |
commit | c919514f854db67be96ec0f0283bdce635d53571 (patch) | |
tree | 4f10ee00dc2fa66fe5ec9ff84e8750d2cf815fd7 /src/client/util/ProseMirrorEditorView.tsx | |
parent | 2bc808135edfc0df1f80c8c52b1015daddf0aecc (diff) | |
parent | 380215f0b934eba265a6b97ab2edc502fd71818a (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/util/ProseMirrorEditorView.tsx')
-rw-r--r-- | src/client/util/ProseMirrorEditorView.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/util/ProseMirrorEditorView.tsx b/src/client/util/ProseMirrorEditorView.tsx index 3e5fd0604..b42adfbb4 100644 --- a/src/client/util/ProseMirrorEditorView.tsx +++ b/src/client/util/ProseMirrorEditorView.tsx @@ -18,23 +18,23 @@ export class ProseMirrorEditorView extends React.Component<ProseMirrorEditorView private _editorView?: EditorView; _createEditorView = (element: HTMLDivElement | null) => { - if (element != null) { + if (element !== null) { this._editorView = new EditorView(element, { state: this.props.editorState, dispatchTransaction: this.dispatchTransaction, }); } - }; + } dispatchTransaction = (tx: any) => { // In case EditorView makes any modification to a state we funnel those // modifications up to the parent and apply to the EditorView itself. const editorState = this.props.editorState.apply(tx); - if (this._editorView != null) { + if (this._editorView) { this._editorView.updateState(editorState); } this.props.onEditorState(editorState); - }; + } focus() { if (this._editorView) { |