0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 23:12:39 +00:00

Move focus method to handleViewChange

This commit is contained in:
Gazook89
2024-09-03 14:48:45 -05:00
parent afa1e7974a
commit 3c6f49aa0a

View File

@@ -82,7 +82,6 @@ const Editor = createClass({
if(prevProps.moveSource !== this.props.moveSource) { if(prevProps.moveSource !== this.props.moveSource) {
this.sourceJump(); this.sourceJump();
}; };
this.codeEditor.current?.codeMirror.focus();
}, },
handleControlKeys : function(e){ handleControlKeys : function(e){
@@ -114,7 +113,10 @@ const Editor = createClass({
this.props.setMoveArrows(newView === 'text'); this.props.setMoveArrows(newView === 'text');
this.setState({ this.setState({
view : newView 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(){ getCurrentPage : function(){