Skip to content

Build your personal knowledge base with Trilium Notes

fix(tree): pasting in editor on middle click (closes #5812)

Elian Doran2cc181d1ac42
diff --git a/apps/client/src/widgets/note_tree.ts b/apps/client/src/widgets/note_tree.ts
index 1a9bb5ce6c..0b89162ea3 100644
--- a/apps/client/src/widgets/note_tree.ts
+++ b/apps/client/src/widgets/note_tree.ts
@@ -253,6 +253,11 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
e.preventDefault();
}
});
+ this.$tree.on("auxclick", (e) => {
+ // Prevent middle click from pasting in the editor.
+ e.stopPropagation();
+ e.preventDefault();
+ });
this.$treeSettingsPopup = this.$widget.find(".tree-settings-popup");
this.$hideArchivedNotesCheckbox = this.$treeSettingsPopup.find(".hide-archived-notes");