fix: Focus on empty document after creation
fix: Clicking in whitespace below document should focus Remove unused component
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user