From bc721337defdd3fd2a74a079e038b0de0cc83ace Mon Sep 17 00:00:00 2001 From: Shawn Erquhart Date: Wed, 21 Jun 2017 17:08:53 -0400 Subject: [PATCH] set rte focus after toolbar click --- .../Widgets/MarkdownControl/VisualEditor/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Widgets/MarkdownControl/VisualEditor/index.js b/src/components/Widgets/MarkdownControl/VisualEditor/index.js index 81628983..2acf9849 100644 --- a/src/components/Widgets/MarkdownControl/VisualEditor/index.js +++ b/src/components/Widgets/MarkdownControl/VisualEditor/index.js @@ -260,7 +260,7 @@ export default class Editor extends Component { handleMarkClick = (event, type) => { event.preventDefault(); - const resolvedState = this.state.editorState.transform().toggleMark(type).apply(); + const resolvedState = this.state.editorState.transform().focus().toggleMark(type).apply(); this.ref.onChange(resolvedState); this.setState({ editorState: resolvedState }); }; @@ -268,7 +268,7 @@ export default class Editor extends Component { handleBlockClick = (event, type) => { event.preventDefault(); let { editorState } = this.state; - const transform = editorState.transform(); + const transform = editorState.transform().focus(); const doc = editorState.document; const isList = this.hasBlock('list-item') @@ -306,7 +306,7 @@ export default class Editor extends Component { } } - const resolvedState = transform.focus().apply(); + const resolvedState = transform.apply(); this.ref.onChange(resolvedState); this.setState({ editorState: resolvedState }); };