mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 21:13:20 +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}
|
isFocus={isFocus}
|
||||||
minHeight={200}
|
minHeight={200}
|
||||||
>
|
>
|
||||||
|
<>
|
||||||
{/* https://www.npmjs.com/package/@monaco-editor/react */}
|
{/* https://www.npmjs.com/package/@monaco-editor/react */}
|
||||||
<Editor
|
<Editor
|
||||||
className='h-full'
|
className='h-full'
|
||||||
@ -107,6 +108,9 @@ const CodeEditor: FC<Props> = ({
|
|||||||
}}
|
}}
|
||||||
onMount={handleEditorDidMount}
|
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>
|
</Base>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user