Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: disable edit context of monaco editor (#15981)

boojack5ea9d058e75c
diff --git a/frontend/src/components/MonacoEditor/MonacoTextModelEditor.vue b/frontend/src/components/MonacoEditor/MonacoTextModelEditor.vue
index 996da01a66..125e313f37 100644
--- a/frontend/src/components/MonacoEditor/MonacoTextModelEditor.vue
+++ b/frontend/src/components/MonacoEditor/MonacoTextModelEditor.vue
@@ -228,17 +228,6 @@ onMounted(async () => {
watchEffect(() => {
emit("update:selection", selection.value);
});
-
- // As the new experimental edit context uses a div instead of a textarea,
- // we need to set the contenteditable attribute to true to ensure it is not
- // captured by browser extensions like Vimium.
- // This is a workaround for the issue that the new edit context is not
- // editable by default.
- // https://github.com/microsoft/vscode/blob/main/src/vs/monaco.d.ts#L3824
- editor
- .getDomNode()
- ?.querySelector<HTMLElement>("div.native-edit-context")
- ?.setAttribute("contenteditable", "true");
} catch (ex) {
console.error("[MonacoEditor] initialize failed", ex);
}
diff --git a/frontend/src/components/MonacoEditor/editor.ts b/frontend/src/components/MonacoEditor/editor.ts
index 9abc8e0d48..153e07e0a9 100644
--- a/frontend/src/components/MonacoEditor/editor.ts
+++ b/frontend/src/components/MonacoEditor/editor.ts
@@ -37,6 +37,10 @@ export const createMonacoEditor = async (config: {
// Create monaco editor.
const editor = monaco.editor.create(config.container, {
+ ...({
+ // https://github.com/microsoft/vscode/blob/main/src/vs/monaco.d.ts#L3824
+ experimentalEditContextEnabled: false,
+ } as any),
...defaultEditorOptions(),
...config.options,
});
@@ -54,6 +58,10 @@ export const createMonacoDiffEditor = async (config: {
// Create monaco diff editor.
const editor = monaco.editor.createDiffEditor(config.container, {
+ ...({
+ // https://github.com/microsoft/vscode/blob/main/src/vs/monaco.d.ts#L3824
+ experimentalEditContextEnabled: false,
+ } as any),
...defaultDiffEditorOptions(),
...config.options,
});