From 82d9bdd7ae22c8f64cdcfe837f5f0c5ff2b91d6a Mon Sep 17 00:00:00 2001 From: Shawn Erquhart Date: Wed, 26 Jul 2017 20:29:19 -0400 Subject: [PATCH] port history shortcuts from Slate, force focus --- .../Markdown/MarkdownControl/VisualEditor/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/Widgets/Markdown/MarkdownControl/VisualEditor/index.js b/src/components/Widgets/Markdown/MarkdownControl/VisualEditor/index.js index b5fb4cda..60569408 100644 --- a/src/components/Widgets/Markdown/MarkdownControl/VisualEditor/index.js +++ b/src/components/Widgets/Markdown/MarkdownControl/VisualEditor/index.js @@ -473,6 +473,17 @@ export default class Editor extends Component { } if (data.isMod) { + + if (data.key === 'y') { + e.preventDefault(); + return state.transform().redo().focus().apply({ save: false }); + } + + if (data.key === 'z') { + e.preventDefault(); + return state.transform()[data.isShift ? 'redo' : 'undo']().focus().apply({ save: false }); + } + const marks = { b: 'bold', i: 'italic',