RME upgrade, fix autoFocus logic
This commit is contained in:
@@ -41,10 +41,20 @@ schema.document.normalize = (
|
||||
class Editor extends React.Component<Props> {
|
||||
editor: *;
|
||||
|
||||
componentDidMount() {
|
||||
if (!this.props.defaultValue) {
|
||||
this.focusAtStart();
|
||||
}
|
||||
}
|
||||
|
||||
setEditorRef = (ref: RichMarkdownEditor) => {
|
||||
this.editor = ref;
|
||||
};
|
||||
|
||||
focusAtStart = () => {
|
||||
if (this.editor) this.editor.focusAtStart();
|
||||
};
|
||||
|
||||
focusAtEnd = () => {
|
||||
if (this.editor) this.editor.focusAtEnd();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user