diff --git a/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx b/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx index fb6f173e67..210cde31e7 100644 --- a/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx +++ b/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx @@ -83,7 +83,7 @@ const CodeEditor: FC = ({ title={title} value={outPutValue} headerRight={headerRight} - isFocus={isFocus} + isFocus={isFocus && !readOnly} minHeight={200} > <> @@ -98,6 +98,7 @@ const CodeEditor: FC = ({ // https://microsoft.github.io/monaco-editor/typedoc/interfaces/editor.IEditorOptions.html options={{ readOnly, + domReadOnly: true, quickSuggestions: false, minimap: { enabled: false }, lineNumbersMinChars: 1, // would change line num width @@ -108,8 +109,6 @@ const CodeEditor: FC = ({ }} onMount={handleEditorDidMount} /> - {/* mask to disable focus but left space to scroll and resize panel */} - {readOnly &&
} diff --git a/web/app/components/workflow/nodes/_base/components/editor/code-editor/style.css b/web/app/components/workflow/nodes/_base/components/editor/code-editor/style.css index 6e3f39a5de..229146ce18 100644 --- a/web/app/components/workflow/nodes/_base/components/editor/code-editor/style.css +++ b/web/app/components/workflow/nodes/_base/components/editor/code-editor/style.css @@ -1,3 +1,8 @@ .margin-view-overlays { padding-left: 10px; +} + +/* hide readonly tooltip */ +.monaco-editor-overlaymessage { + display: none !important; } \ No newline at end of file