fix: monaco editor disabled state

This commit is contained in:
Andras Bacsai
2025-01-14 08:49:03 +01:00
parent 36b16e9d62
commit aab5398b80
3 changed files with 17 additions and 24 deletions

View File

@@ -54,7 +54,10 @@
fontSize: monacoFontSize,
lineNumbersMinChars: 3,
automaticLayout: true,
language: '{{ $language }}'
language: '{{ $language }}',
domReadOnly: '{{ $readonly ?? false }}',
contextmenu: '!{{ $readonly ?? false }}',
renderLineHighlight: '{{ $readonly ?? false }} ? none : all'
});
const observer = new MutationObserver((mutations) => {
@@ -95,7 +98,7 @@
}, 5);" :id="monacoId">
</div>
<div class="relative z-10 w-full h-full">
<div x-ref="monacoEditorElement" class="w-full h-96 text-md"></div>
<div x-ref="monacoEditorElement" class="w-full h-96 text-md {{ $readonly ? 'opacity-65' : '' }}"></div>
<div x-ref="monacoPlaceholderElement" x-show="monacoPlaceholder" @click="monacoEditorFocus()"
:style="'font-size: ' + monacoFontSize"
class="w-full text-sm font-mono absolute z-50 text-gray-500 ml-14 -translate-x-0.5 mt-0.5 left-0 top-0"