fix: Focus on empty document after creation

fix: Clicking in whitespace below document should focus
Remove unused component
This commit is contained in:
Tom Moor
2020-02-26 22:29:22 -08:00
parent dac2d43f55
commit f0afa67012
5 changed files with 22 additions and 50 deletions

View File

@@ -19,11 +19,15 @@ class DocumentEditor extends React.Component<Props> {
}
focusAtStart = () => {
if (this.editor) this.editor.focusAtStart();
if (this.editor) {
this.editor.focusAtStart();
}
};
focusAtEnd = () => {
if (this.editor) this.editor.focusAtEnd();
if (this.editor) {
this.editor.focusAtEnd();
}
};
render() {
@@ -33,6 +37,7 @@ class DocumentEditor extends React.Component<Props> {
<React.Fragment>
<Editor
ref={ref => (this.editor = ref)}
autoFocus={!this.props.defaultValue}
plugins={plugins}
grow={!readOnly}
{...this.props}