fix monaco

This commit is contained in:
2026-03-06 21:42:03 +01:00
parent e24467a074
commit 71e81fefd4

View File

@@ -68,6 +68,22 @@ export const ConfigNode = memo(function ConfigNode({ id, data }: Props) {
const handleEditorMount = useCallback((editor: any, monaco: any) => {
editorRef.current = editor
monacoRef.current = monaco
// Prevent React Flow and other global handlers from interfering with typing
try {
editor.onKeyDown((e: any) => {
if (e?.browserEvent) {
e.browserEvent.stopPropagation()
}
})
editor.onMouseDown((e: any) => {
if (e?.event) {
e.event.stopPropagation()
}
})
} catch {
// ignore if Monaco internals change
}
}, [])
const insertIncludeFromNode = useCallback(
@@ -162,7 +178,7 @@ export const ConfigNode = memo(function ConfigNode({ id, data }: Props) {
</div>
)}
<div style={{ height: 180 }} className="w-full">
<div style={{ height: 180 }} className="w-full nodrag nopan">
<Editor
height="100%"
defaultLanguage="yaml"
@@ -177,8 +193,6 @@ export const ConfigNode = memo(function ConfigNode({ id, data }: Props) {
glyphMargin: false,
renderLineHighlight: 'none',
lineDecorationsWidth: 2,
lineNumbersMinChars: 2,
scrollBeyondLastLine: false,
padding: { top: 0, bottom: 4 },
lineNumbers: 'on',
}}