Skip to content

Build your personal knowledge base with Trilium Notes

client: Fix F1 shortcut in mind map (fixes #387)

Elian Doran3a87f8bc31a9
diff --git a/src/public/app/widgets/type_widgets/mind_map.js b/src/public/app/widgets/type_widgets/mind_map.js
index e0b43f79a7..54aa545371 100644
--- a/src/public/app/widgets/type_widgets/mind_map.js
+++ b/src/public/app/widgets/type_widgets/mind_map.js
@@ -26,6 +26,15 @@ export default class MindMapWidget extends TypeWidget {
doRender() {
this.$widget = $(TPL);
this.$content = this.$widget.find(".mind-map-container");
+ this.$content.on("keydown", (e) => {
+ /*
+ * Some global shortcuts interfere with the default shortcuts of the mind map,
+ * as defined here: https://mind-elixir.com/docs/guides/shortcuts
+ */
+ if (e.key === "F1") {
+ e.stopPropagation();
+ }
+ });
super.doRender();
}