@@ -39,11 +39,11 @@ const MONACO_EDITOR_CONFIG = {
39
39
} ;
40
40
41
41
export const CodeEditor = ( { onRunEvalscriptClick } ) => {
42
- const editorDOMRef = useRef ( ) ;
42
+ const monacoEditorDOMRef = useRef ( ) ;
43
43
const editorRef = useRef ( ) ;
44
44
const monacoRef = useRef ( ) ;
45
45
const headerEditorRef = useRef ( ) ;
46
- const codeEditorRef = useRef ( ) ;
46
+ const editorWindowRef = useRef ( ) ;
47
47
const {
48
48
editorPosition,
49
49
editorSize,
@@ -53,12 +53,12 @@ export const CodeEditor = ({ onRunEvalscriptClick }) => {
53
53
handleResizeMouseDown,
54
54
handleFullscreenClick,
55
55
handleExitFullscreenClick,
56
- } = useFreeEditor ( codeEditorRef , headerEditorRef ) ;
56
+ } = useFreeEditor ( editorWindowRef , headerEditorRef ) ;
57
57
58
58
useEffect ( ( ) => {
59
59
loader . init ( ) . then ( ( monaco ) => {
60
60
const editor = monaco . editor . create (
61
- editorDOMRef . current ,
61
+ monacoEditorDOMRef . current ,
62
62
MONACO_EDITOR_CONFIG
63
63
) ;
64
64
@@ -117,7 +117,7 @@ export const CodeEditor = ({ onRunEvalscriptClick }) => {
117
117
118
118
if ( isDocked ) {
119
119
return (
120
- < div ref = { codeEditorRef } className = "code-editor-window-docked" >
120
+ < div ref = { editorWindowRef } className = "code-editor-window-docked" >
121
121
< div className = "code-editor-top-panel" ref = { headerEditorRef } >
122
122
< button className = "editor-button" onClick = { handleDockedClick } >
123
123
< BiExpand className = "code-editor-expand-icon" />
@@ -126,7 +126,7 @@ export const CodeEditor = ({ onRunEvalscriptClick }) => {
126
126
< div
127
127
style = { { height : "100%" } }
128
128
className = "code-editor-docked"
129
- ref = { ( el ) => ( editorDOMRef . current = el ) }
129
+ ref = { ( el ) => ( monacoEditorDOMRef . current = el ) }
130
130
> </ div >
131
131
</ div >
132
132
) ;
@@ -137,8 +137,9 @@ export const CodeEditor = ({ onRunEvalscriptClick }) => {
137
137
style = { {
138
138
transform : `translate(${ editorPosition . x } px, ${ editorPosition . y } px)` ,
139
139
...editorSize ,
140
+ position : "absolute" ,
140
141
} }
141
- ref = { codeEditorRef }
142
+ ref = { editorWindowRef }
142
143
className = "code-editor-window"
143
144
>
144
145
< div
@@ -175,7 +176,7 @@ export const CodeEditor = ({ onRunEvalscriptClick }) => {
175
176
< div
176
177
style = { { height : editorSize . height - 96 } }
177
178
className = "code-editor"
178
- ref = { ( el ) => ( editorDOMRef . current = el ) }
179
+ ref = { ( el ) => ( monacoEditorDOMRef . current = el ) }
179
180
> </ div >
180
181
< div
181
182
onMouseDown = { handleResizeMouseDown }
0 commit comments