mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 20:03:22 +08:00
fix: code editor readonly can get focus
This commit is contained in:
parent
9eff8715fb
commit
794c57b938
@ -86,6 +86,7 @@ const CodeEditor: FC<Props> = ({
|
||||
isFocus={isFocus}
|
||||
minHeight={200}
|
||||
>
|
||||
<>
|
||||
{/* https://www.npmjs.com/package/@monaco-editor/react */}
|
||||
<Editor
|
||||
className='h-full'
|
||||
@ -107,6 +108,9 @@ const CodeEditor: FC<Props> = ({
|
||||
}}
|
||||
onMount={handleEditorDidMount}
|
||||
/>
|
||||
{/* mask to disable focus but left space to scroll and resize panel */}
|
||||
{readOnly && <div className='absolute left-0 top-0 right-[10px] bottom-[12px] z-10'></div>}
|
||||
</>
|
||||
</Base>
|
||||
</div>
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user