diff --git a/app/scenes/Document/components/Editor.js b/app/scenes/Document/components/Editor.js index 385fe8a84..5ab15a5c6 100644 --- a/app/scenes/Document/components/Editor.js +++ b/app/scenes/Document/components/Editor.js @@ -21,7 +21,7 @@ type Props = { isDraft: boolean, isShare: boolean, readOnly?: boolean, - onSave: () => mixed, + onSave: ({ publish?: boolean, done?: boolean }) => mixed, innerRef: { current: any }, }; @@ -50,8 +50,13 @@ class DocumentEditor extends React.Component { }; handleTitleKeyDown = (event: SyntheticKeyboardEvent<>) => { - if (event.key === "Enter" && !event.metaKey) { + if (event.key === "Enter") { event.preventDefault(); + if (event.metaKey) { + this.props.onSave({ publish: true, done: true }); + return; + } + this.insertParagraph(); this.focusAtStart(); return;