From 3c6f49aa0a5bd3632ec2187db81d77c97406c8b9 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Tue, 3 Sep 2024 14:48:45 -0500 Subject: [PATCH] Move focus method to handleViewChange --- client/homebrew/editor/editor.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 0cc31cb40..24e975ebc 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -82,7 +82,6 @@ const Editor = createClass({ if(prevProps.moveSource !== this.props.moveSource) { this.sourceJump(); }; - this.codeEditor.current?.codeMirror.focus(); }, handleControlKeys : function(e){ @@ -114,7 +113,10 @@ const Editor = createClass({ this.props.setMoveArrows(newView === 'text'); this.setState({ view : newView - }, this.updateEditorSize); //TODO: not sure if updateeditorsize needed + }, ()=>{ + this.codeEditor.current?.codeMirror.focus(); + this.updateEditorSize(); + }); //TODO: not sure if updateeditorsize needed }, getCurrentPage : function(){