It would be nice if the onLoad callback would have the editor reference as a parameter
e.g onLoad(editor: IStandaloneCodeEditor)
This would make it more convenient to use addAction, scroll something in to view on load or focus the editor.
Right now you need to get and store the ref yourself, which is fine but unnecessary imo.
const editorRef = useRef<mEditor.IStandaloneCodeEditor>();
return (
<MonacoEditorReactComp
ref={(ref) => {
editorRef.current = ref?.getEditorWrapper().getEditor();
}}
/>
)
More convenient:
return (
<MonacoEditorReactComp
onLoad={(editor) => {
editor.addAction( . . . );
editor.revealLineInCenter( . . . );
editor.setSelection( . . . );
editor.focus( . . . );
}}
/>
)
It would be nice if the onLoad callback would have the editor reference as a parameter
e.g
onLoad(editor: IStandaloneCodeEditor)This would make it more convenient to use
addAction, scroll something in to view on load or focus the editor.Right now you need to get and store the ref yourself, which is fine but unnecessary imo.
More convenient: