fix: Occasional render loop in editor toolbar (#1518)

* fix: CMD+S should save when editor title is focused

* fix: Bump RME, fixes various small editor issues
This commit is contained in:
Tom Moor
2020-09-07 10:42:51 -07:00
committed by GitHub
parent f13696dd2a
commit 709c3e78bd
3 changed files with 19 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ type Props = {
isDraft: boolean,
isShare: boolean,
readOnly?: boolean,
onSave: () => mixed,
innerRef: { current: any },
};
@@ -58,6 +59,12 @@ class DocumentEditor extends React.Component<Props> {
if (event.key === "Tab" || event.key === "ArrowDown") {
event.preventDefault();
this.focusAtStart();
return;
}
if (event.key === "s" && event.metaKey) {
event.preventDefault();
this.props.onSave();
return;
}
};