fix: hide readonly tooltip

This commit is contained in:
Joel 2024-03-27 14:47:14 +08:00
parent 6256a3fadb
commit 78a851d240
2 changed files with 7 additions and 3 deletions

View File

@ -83,7 +83,7 @@ const CodeEditor: FC<Props> = ({
title={title}
value={outPutValue}
headerRight={headerRight}
isFocus={isFocus}
isFocus={isFocus && !readOnly}
minHeight={200}
>
<>
@ -98,6 +98,7 @@ const CodeEditor: FC<Props> = ({
// 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<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>

View File

@ -1,3 +1,8 @@
.margin-view-overlays {
padding-left: 10px;
}
/* hide readonly tooltip */
.monaco-editor-overlaymessage {
display: none !important;
}