port history shortcuts from Slate, force focus

This commit is contained in:
Shawn Erquhart 2017-07-26 20:29:19 -04:00
parent 4ac63954ca
commit 82d9bdd7ae

View File

@ -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',